PDA

View Full Version : Determining that Num Lock is on



LepaBrena
20th February 2017, 10:51
Is there a way to determine that Num Lock is on?

d_stranz
20th February 2017, 19:44
Install an event filter or monitor key events and check for Qt:: Key_NumLock. This will only work when your app or a widget within it has the input focus. Most likely if the user presses the NumLock key when a different app has input focus, your app won't be notified. I do not know if there is a way to determine a priori if the NumLock key is pressed during a normal key event.

Lesiok
21st February 2017, 06:53
You can do this with the help of native system functions. Ask uncle Google.

LepaBrena
21st February 2017, 07:47
This will only work when your app or a widget within it has the input focus. Most likely if the user presses the NumLock key when a different app has input focus, your app won't be notified..

I need to check it before user presses any numpad key.

Added after 5 minutes:


You can do this with the help of native system functions. Ask uncle Google.

I ask uncle Google before any post. I did not find the answer for this, so I asked.
Can you write me link where I can find solution?

Lesiok
21st February 2017, 08:56
I'll be malicious: somewhere they should learn how to ask Google :p
Here you are (http://stackoverflow.com/questions/24822505/how-to-tell-if-shift-is-pressed-on-numpad-input-with-numlock-on-or-at-least-get).

LepaBrena
21st February 2017, 09:09
You are right. Need some instructions for google search and for writing posts too :)
This is solution for win and linux, but I'm looking something for android (working platform: win).