Before this try Ctrl+Alt+F1. You might get a full-screen terminal where you can log in and kill the offending process. Ctrl+Alt+F7 to get back to the desktop.
I had to use this just today when ddd stole all other mouse and keyboard input.
That's because it's turned off by default on modern X.
You can enable them in the keyboard options of your DE, or directly with setxkbmap on startup (sorry can't look up the exact options right now) if you're not using one.
I had to use this just today when ddd stole all other mouse and keyboard input.