Turn on num lock permanently

I would like to have my num-lock turned on permanently. I never turn it off. But every once in a while it gets turned off. Is there any way to do this in Windows 7 and Ubuntu 10.10.?


For windows

Have numlock activate on startup with a VBS script

create a custom layout with MSKLC with numlock disabled

For linux

Enable numlock at boot

disable key with xmodmap


I compiled a usable solution to this. Using a .reg file I turn the numlock key on at boot, as well as disable the numlock key in the keyboard mappings.

The file looks like this:

Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2147483650"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,00,00,45,00,00,00,00,00

More about the background is on my blog.