Results 1 to 6 of 6

Thread: Determining that Num Lock is on

  1. #1

    Default Determining that Num Lock is on

    Is there a way to determine that Num Lock is on?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Determining that Num Lock is on

    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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Determining that Num Lock is on

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

  4. #4

    Default Re: Determining that Num Lock is on

    Quote Originally Posted by d_stranz View Post
    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:


    Quote Originally Posted by Lesiok View Post
    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?
    Last edited by LepaBrena; 21st February 2017 at 07:47.

  5. #5
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Determining that Num Lock is on

    I'll be malicious: somewhere they should learn how to ask Google
    Here you are.

  6. #6

    Default Re: Determining that Num Lock is on

    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).
    Last edited by LepaBrena; 21st February 2017 at 09:18.

Similar Threads

  1. Replies: 1
    Last Post: 23rd May 2014, 06:58
  2. Determining QTreeWidget parent
    By cnbp173 in forum Qt Programming
    Replies: 5
    Last Post: 23rd April 2013, 13:17
  3. Need help determining proper Qt distribution
    By bizmopeen in forum Newbie
    Replies: 2
    Last Post: 22nd December 2009, 20:47
  4. Determining that Caps Lock is on
    By ntp in forum Qt Programming
    Replies: 4
    Last Post: 8th October 2009, 00:08
  5. Determining no. of CPU cores available
    By cnbp173 in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 17:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.