Is there any possibility to disable the keyboard key globally. I am trying to make a lock screen program. And I am trying to disable the Alt, Ctrl, Esc, Tab and Backspace key. ? Thank's before...![]()
Is there any possibility to disable the keyboard key globally. I am trying to make a lock screen program. And I am trying to disable the Alt, Ctrl, Esc, Tab and Backspace key. ? Thank's before...![]()
You can try grabbing the keyboard and handling key events yourself.
Thank you for your quick reply. I have heard it but I don't know how to use it. Maybe I have to read the QT Assistant. At which section should I read anyway.
Just write "grab" to the index-tab and choose appropriate topic.
J-P Nurmi
Hm... I have try to type "grabkeyboard" and it show one method. But this method is seem like to get focus. That's why, I don't think that's the key. Or am I wrong in reading the help? Coz the grabKeyboard() method doesn't return value, nor get parameter. So how could I handle some of the key.
Or maybe I must use QKeyEvent ??
Did you actually read what the function documentation says? After reading it, it doesn't make sense what you're saying.![]()
J-P Nurmi
Ow Really...?
Well, I am very newbie in QT. Maybe there are some misunderstandings in reading the help.
Btw, I have try by doing this:
But the effect of this code, the program become hang. Cannot be resize or anything except the close button on the top right, to close the program.Qt Code:
if(e->key()==16777251){ grabKeyboard(); } }To copy to clipboard, switch view to plain text mode
Did you read until that part?
You don't call it when you receive a key event - you call it to prevent other widgets from receiving key events. And it also says you have to eventually release the keyboard...This widget receives all keyboard events until releaseKeyboard() is called; other widgets get no keyboard events at all.
Oow... Hm.. OK.. I understand what do you mean now..![]()
Cheers,
Phillip
--- Please post the solution you got to solve your problem. It may help others.
Bookmarks