NumLock - How do you just keep it "on" all the time?


  1. Posts : 87
    Windows 10 Pro 64-bit
       #1

    NumLock - How do you just keep it "on" all the time?


    A couple of things I've tried:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Provides a visual

    TrayStatus . . . https://www.traystatus.com/

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Hear a tone when you press CAPS LOCK, NUM LOCK, or SCROLL LOCK

    Control Panel / Ease of Access Center / Make the keyboard easier to use / [check] Turn on Toggle keys

    Sometimes, a program will quietly toggle it off, though - like Excel

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    I've looked at reviews for some of these programs that are supposed to keep NumLock on all the time, but it looks like they fail sometimes.

    Maybe just "indicating" a state change is easier, for some reason. Is there a program that gives you a tone for that?

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      My Computer


  2. Posts : 26,452
    Windows 11 Pro 22631.3527
       #2

    I have an option in my Bios to turn it on or off.
      My Computer


  3. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #3

    The NumLock status is is stored in the registry at HKEY_CURRENT_USER\Control Panel\Keyboard using an entry called InitialKeyboardIndicators. The entry has 2 states - 0 and 2, corresponding to NumLock Off and NumLock On respectively.

    When I'm setting up a new device I use the following REG file:

    Code:
    Windows Registry Editor Version 5.00
    
    ; Set NumLock ON as default for new accounts
    [HKEY_USERS\.DEFAULT\Control Panel\Keyboard]
    "InitialKeyboardIndicators"="2"
    
    ; Set NumLock ON as default for current logged on user account
    [HKEY_CURRENT_USER\Control Panel\Keyboard]
    "InitialKeyboardIndicators"="2"
    I haven't experienced any issues with NumLock turning itself off, even when using Excel.

    Using AutoHotkey it would be easy to write a small program to check for a changed state (using a timer and RegRead) and to sound a warning tone if the state changed. However, constantly checking the state would invariably take processor cycles.

    An alternative would be a scheduled task set to check the NumLock state at logon.
      My Computer


  4. Posts : 915
    Windows 10 Pro 64bit 22H2 19045.3324
       #4

    I found these other values in my own setup notes:

    Method 1 – Registry Setting

    Navigate to the following location in the registry:

    HKEY_CURRENT_USER\Control Panel\Keyboard\InitialKeyboardIndicators

    Change the value of InitialKeyboardIndicators

    0 - Turn all indicators Off (NumLock, CapsLock, ScrollLock)

    1 - Turn CapsLock On

    2 - Turn NumLock On

    3 - Turn CapsLock and NumLock On

    4 - Turn ScrollLock On

    5 - Turn CapsLock and ScrollLock On

    6 - Turn NumLock and ScrollLock On

    7 - Turn all indicators On (NumLock, CapsLock, ScrollLock)
      My Computers


  5. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #5

    @Farvatten - Excellent info. I had never seen a complete list before. Thank you.
      My Computer


  6. Posts : 87
    Windows 10 Pro 64-bit
    Thread Starter
       #6

    Instead of VBA alone, get VBA to use Windows Script Host


    Excel 2010 VBA SendKeys was doing it - in a macro that I made - this works:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    SendKeys is messing with my NumLock key via VBA code in Access form . . . SendKeys is messing with my NumLock key via VBA code in Access form - Stack Overflow

    The SendKeys() function that is built-in VBA has really a side effect that causes NumLock to be deactivated.

    But you can use a workaround and call another implementation of the same function that is a part of WSCRIPT component (a part of Windows operating system).

    The following sample code shows, how a reference to this component can be made and then its method called:

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.SendKeys "^g", True


    This way, you get the same functionality (calling Ctrl-G keyboard shortcut in the example), but there is no issue with NumLock in this case.

    . . . Failed to send TAB if Numlock enabled

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Windows Script Host . . . Windows Script Host - Wikipedia

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    This is too complicated, and I don't think that SendKeys would be a big security risk for the home user:

    API: Replacement for Sendkeys . . . The problem with SendKeys causing NumLock to turn off is well known in the Office/VB environment. Here's a custom MySendkeys routine which you can use as a replacement instead . . . Note: Under most circumstances, SendKeys is not recommended in a production environment. This is because the keystrokes are processed by whichever window is currently active on the desktop. Obviously this will cause unpredictable behavior (to say the least) in case another app receives the focus while your code is processing the Sendkeys statement. If you're unlucky, the keystrokes when sent to application "y" may cause all documents to be deleted or the hard drive to be formatted. So, simply put, try to avoid Sendkeys at all cost . . . API: Replacement for Sendkeys

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:26.
Find Us




Windows 10 Forums