How can we block keyboard input in Qt?
General and Desktop
3
Posts
3
Posters
7.5k
Views
1
Watching
-
wrote on 23 Feb 2012, 14:41 last edited by
i'm writing an application that can block keyboard globally. i have searched in internet but i didn't find it.
Thank you in advance. -
wrote on 23 Feb 2012, 15:24 last edited by
Globally? As in your whole system?
Qt does not support that (luckely!). I would hate any application stealing my input focus like that. You'll have to resort to platform specific tricks. -
wrote on 24 Feb 2012, 03:46 last edited by
You can use @QWidget::setEnabled(false)@ to disable mouse and keyboard events for a specific widget. Globally, you could try this thread: http://www.head-fi.org/t/100145/disable-keyboard-input-with-c-c. It talks about using c/c++ to disable keyboard input events, not sure why you would want to do that though.
1/3