17

So this question is not about having num lock on by default.

Is it possible to have num lock turned on, and remove the ability of the num lock button on the keyboard to affect that state?

EDIT (because):

In my keyboard the Home button is really close to the numlock. At work I often use Home and the numpad, but sometimes I accidentally hit the numlock too. As a result my numpad gets turned off which is really sucks when I have to type a lot of numbers and after a while I realise I typed nothing because numlock turned off numpad.

5
  • 5
    remove the numlock key and epoxy the switch in the on position, pop the key back on.
    – Moab
    Jan 16, 2016 at 16:55
  • W-why would you need that? just curious Jan 18, 2016 at 16:53
  • @RegisteredUser see my edit Jan 18, 2016 at 16:58
  • superuser.com/a/688895 + superuser.com/a/688891
    – dxiv
    Jan 18, 2016 at 20:27
  • Wish I can upvote you 100 times. Same here. Especially after I switch back and realized that Insert mode is on by hitting 0 and there is no indicator for that. I just don't get it. Who is using Ins in the 21st center?
    – River
    Oct 23, 2021 at 20:01

9 Answers 9

7
+100

I use CapShift and it's free:

https://www.donationcoder.com/Software/Skrommel/index.html#CAPshift

"CAPshift extends the Caps Lock key by slowing it down...

  • Hold down for 0.5 sec to enable/disable.
  • Hold down for 1 sec to show the menu.
  • Rightclick the tray icon to show the menu.
  • Also slows down F1, Insert, NumLock and ScrollLock."

The Advantage is: You don't lose the ability to change NumLock if you really need to.

1
  • Sounds good but the installer does not run on Windows 8.1 :[ Jan 19, 2016 at 15:23
6

Physically remove the NumLock key. When your finger goes to press it, it won't be there.

2
  • The foolproof solution. Jan 20, 2016 at 0:32
  • 7
    It is actually not foolproof. Some software (HyperV for example) can toggle numlock off again, and when you have removed the key from the keyboard (or used SharpKeys) you have to fool around and reboot to get it back on.
    – StingyJack
    Oct 25, 2017 at 14:22
6

If you use Autohotkey, you can add the following line to your script:

SetNumLockState, AlwaysOn

Be sure to put this line before your hotkeys. I put it at the very beginning of my script so I make sure it always works fine, if you put it in the middle or at the end of your script, it may not work.

1
  • 2
    If yer a AutoHotKey n00b like me, right-click in Startup, choose New | AutoHotKey Script, add that to it, and add #NoTrayIcon if you don't want an icon in yer system tray.
    – CodeLurker
    Apr 25, 2021 at 14:50
3

It's possible to automatically put it back on (within a few milliseconds) when it gets turned off, via an application.

This guy created an autohotkey script for it which he calls "Numlock Enforcer" http://www.donationcoder.com/forum/index.php?topic=9018.0

Not to most elegant solution, but it should work.

2

Maybe not the answer you are looking for, but it solved that problem for me:

Activate the sound for the Lock keys in Windows (in Windows 10: Control Panel\Ease of Access\Ease of Access Center\Make the keyboard easier to use\Turn on Toggle keys)

That way, when you hit it, it beeps, and you realize it right away. It actually trained me to not hit it anymore at all, because the signal is right when it happens.

1
  • Nice idea, working with built-in functionality!
    – Oliver
    Jan 19, 2016 at 13:20
0

The BIOS might have a setting to disable the NumLock key, but we need to know your computer-model and BIOS-version to discuss this more in depth. Typically, one boots into the BIOS and looks for an item named "NumLock State", "Bootup NumLock State" or similar, press Enter and use the arrow keys to select "Off" or "Disabled", then press Enter.

For Windows hackers, the registry contains in HKCU\Control Panel\Keyboard an item named InitialKeyboardIndicators which has the undocumented value of 1 to disable the NumLock. Its effectiveness may vary according to the version of Windows.

The brutal solution is to pop off the Numlock key cap and use a pen to change its setting when required. The setting will normally stick, since Windows XP and later remember its state across boots (unless the BIOS or other setting interferes).

0

Step 1

Change the registry to set initial state of NumLock to on at startup:

HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators
  Set to Value to 2

Step 2

Add an AutoHotkey script to monitor the key and ensure it cannot be turned off. Install AutoHotkey, and create a new script named MyBestNumlockHack.ahk. Put this script in your C:\Users\{User Name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup directory.

Numlock::
  if (!GetKeyState("NumLock", "T"))
    SetNumLockState, On
  return
0

Make a timer and call it NumlOn. Set the interval on 100.

Public Const VK_NUMLOCK = &H90
Declare Function GetKeyState Lib "user32" Alias "GetKeyState" _
(ByVal ByValnVirtKey As Integer) As Short
Dim NLKey as boolean

Private Sub me_keyDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    If e.KeyCode = Keys.NumLock And Not NLKey Then
        If Not GetKeyState(VK_NUMLOCK) Then
            e.Handled = True
            NumlOn.Start()
            Exit Sub
        End If
    End If
End sub

Private Sub NumlOn_Tick(sender As Object, e As EventArgs) _ 
Handles NumlOn.Tick
    NLKey = True
    If Not GetKeyState(VK_NUMLOCK) Then numlockON()
    Application.DoEvents()
    NumlOn.Stop()
    NLKey = False
 End Sub
1
  • 3
    Where’s the beef? I suppose you want the use to put this code into a file. What then?  How do you use it?  How does it work? Please do not respond in comments; edit your answer to make it clearer and more complete. Mar 23, 2018 at 2:18
0

Forgot a sub... This is fully working

Public Const VK_NUMLOCK = &H90
Declare Function GetKeyState Lib "user32" Alias "GetKeyState" _
(ByVal ByValnVirtKey As Integer) As Short

Private Sub numlockON()
    keybd_event(VK_NUMLOCK, 0, 0, 0) ' Press NUMLOCK key down
    keybd_event(VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0)
End Sub

Private Sub me_keyDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    If e.KeyCode = Keys.NumLock And Not NLKey Then
        If Not GetKeyState(VK_NUMLOCK) Then
            e.Handled = True
            NumlOn.Start()
            Exit Sub
        End If
    End If
End sub

Private Sub NumlOn_Tick(sender As Object, e As EventArgs) Handles NumlOn.Tick
    NLKey = True
    If Not GetKeyState(VK_NUMLOCK) Then numlockON()
    Application.DoEvents()
    NumlOn.Stop()
    NLKey = False
End Sub
1
  • 1
    Welcome to Super User. Rather than posting multiple answers, please just correct the previous answer and delete this one, or delete that one if it needs the changes in this one. Also, what Scott said on your other answer.
    – fixer1234
    Mar 23, 2018 at 2:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .