Once upon a time, I had my mouse and keyboard input rudely stolen from me by a rogue SDL app. I had way too much stuff going on in X to throw it all away for some rude app, so I fought my way back! Here's how I did it...
First order of business is to kill the app that's causing the problem in the first place. If you can switch to a console with Ctrl+Alt+Fn, you're good to go, otherwise you'll have to login remotely. If you have no other machines handy, you may have to admit defeat and either kill X with Ctrl+Alt+Backspace, or, even worse, reboot the machine. kill, kill, and kill -9 until there is no remaining trace of the program.
There's a number of loosely related and intertwined steps to this.
kill -USR1
- I honestly have no idea what this
is meant for, but it surely did something. Namely, it messed up my
virtual consoles, but only temporarily. A ^L or 'clear' in your shell
should get them back to normal. Update: Another X lockup was
completely fixed by doing this a few times in a row. So it is quite
useful. :)xrefresh
- This didn't seem to do anything, but hey, maybe
it'll do something for you.xvidtune -unlock
- This got my mouse input (mostly) back (woohoo!)./* compile with: gcc `sdl-config --cflags --libs` foo.c */
#include "SDL.h"
int main(void) {
SDL_Init(SDL_INIT_VIDEO);
SDL_WM_GrabInput(SDL_GRAB_ON);
SDL_ShowCursor(0);
SDL_WM_GrabInput(SDL_GRAB_OFF);
SDL_ShowCursor(1);
SDL_Quit();
return 0;
}
UPDATE - Apparently this does help; Neverball bombed on me, and this
fixed my mouse afterwards.Thanks to "fhffhqvb" and "izn0g" from #debian on freenode, and "Yorick" from #sdl on freenode.