Answer the question
In order to leave comments, you need to log in
How to kill a process that is blocking input devices?
In a C ++ project I use OIS to work with input devices, but for some reason, when the listener on the keyboard is enabled and the current application is active, the system key combinations do not work, for example, when OIS is not enabled, Alt + F4 works, but similar commands do not work with it respond.
Everything would be fine if in debug mode, when the application catches an error, the keyboard and mice were not blocked, because of which I cannot kill the process by any means: neither through the graphical environment, nor through hotkey
UPDATE: I will add that the input is blocked - output when the application is running, but Alt-Tab allows you to refocus on another window, but when debugging through GDB, even this cannot be done
Answer the question
In order to leave comments, you need to log in
The dumbest way is
touch killthemall.sh
chmod +x killthemall.sh
echo "
#!/bin/bash
a = `ps -ax |grep listener`
for b in $a
do
kill -9 $b
done
" > killthemall.sh
and then put
crontab -e
*/1 * * * * /path/killthemall.sh into the cron,
the script will run every minute to check.
You can sit and finish adding rc.d to autoload, make a while sleep 1 loop and then it will monitor and kill this process when loading.
But this is fire fighting. Understand where the legs grow from.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question