18

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.

9 Answers9

7

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.

Oliver
  • 618
6

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

B540Glenn
  • 1,095
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.

Shayan
  • 1,893
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.

cloneman
  • 1,124
3

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.

Aganju
  • 10,161
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).

harrymc
  • 498,455
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
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