1819681 Members
3540 Online
109605 Solutions
New Discussion юеВ

Disable NumLock key

 
Billy Ng
Occasional Advisor

Disable NumLock key

I would like to disable "NumLock" key. How d i do that?
6 REPLIES 6
John Dvorchak
Honored Contributor

Re: Disable NumLock key

You didn't mention the OS or the system so this is a shot in the dark:
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063231285

Here is the command you can reference the above article if you want to know what really happens:

Use the following command to disable the Numlock key:

/usr/bin/X11/xmodmap -e "keycode 127 = Home"


If it has wheels or a skirt, you can't afford it.
S.K. Chan
Honored Contributor

Re: Disable NumLock key

First you need to find out which keycode Num_Lock is defined as. Run this ..
# /usr/bin/X11/xmodmap|grep Num_Lock
In my case it shows ..

152 0xff7f (Num_Lock)

All you have to do is set the keycode 152 to nothing.

# /usr/bin/X11/xmodmap -e "keycode 152 = """

Now if you press num lock, it should do nothing.
John Dvorchak
Honored Contributor

Re: Disable NumLock key

S.K. was correct but since I was guessing at the keyboard you are using, I guessed that you were on a PC running an X server and the scancode I gave you was for a PS/2 keyboard. No matter what keyboard you are using you should do as S.K suggested and determine the correct scancode before you start disabling keys.
If it has wheels or a skirt, you can't afford it.
Billy Ng
Occasional Advisor

Re: Disable NumLock key

I tried to use the command: xmodmap. It works partially.
The NumLock key is not functioning as it should, but it is still on (you can see the LED night on the PS/2 keyboard). Whenever the NumLock key is on, the windows are sticking (not movable by the mouse). That is the reason why I want to disable the NumLck key. Thanks!!
Alex Glennie
Honored Contributor

Re: Disable NumLock key

a) what and where is the Xserver running/ on ... can we clear up whether this is PC Xemualtion or a native Xserver ?

b) please post xmodmap | grep Num_Lock output

c) Windows are sticking .... Xwindows ... all of them or just a particular application ? Are we talking citrix ... you may like to read this ->

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x38e0cdec06f1d61190050090279cd0f9,00.html

Also note ;

On a PC running an X emulation software , the Numlock KeyPress Events repeat when the Numlock key is depressed, but the LED indicator light only toggles once and the actual keycode value returned differs based on whether or not the Numlock is 'on' or 'off'.
so you may want to look into xev - this utility can be found on public domain sites and lastly what is the O/S... things may have changed between 10.20 and 11.00 ....
Billy Ng
Occasional Advisor

Re: Disable NumLock key

Thanks guys for your inputs!! I have found a way to solve the "sticking" windows problem w/o disabling the NumLock key. I found that the NumLock key was assigned for mod2 when I run this command: "xmodmap -pm". When the NumLock key is on, the system "thinks" L_Shift, R_Shift, L_Alt and R_Alt are pressed. This caused the window "sticking". To solve this, I just ran "xmodmap -e "clear mod2"". Windows are not "sticking" anymore.