I have a work laptop with numpad keys, and the navigation keys (home/end, page up/down, insert, delete) are also there. And their behavior depends on Numlock key state.

I don't have a habit of using numpad digits - in fact, I don't need them at all. But I need home, end, insert, delete and combinations with them. And now I accidentally press that Numlock 100 times per day (it's too close to Return) and getting 7, when I need to select text, 0 when need insert text, and so on.

I am starting to hate this key.

I tried to use Tweaks, but "as in Windows" is not what I need, and "as in MacOps" produce only digits.

I need visa-versa: completely get rid of digits from numpad and disable numlock. End should set cursor to the line end, and shift+end should select text from cursor position to the line end - no matter what.

Is that possible?


3 Answers 3


The links provided by @Rinzwind are very useful and I upvote his comment, I thought to write below steps just to let you get quick output/ result what you are looking for, I recommend you to follow those links to understand the concept and become master in mappings..

  1. Turn off the Num_Lock key.

  2. run xmodmap command in terminal..

you will get the result similar to below..

pratap@i7-6550U:~$ xmodmap
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

    shift       Shift_L (0x32),  Shift_R (0x3e)
    control     Control_L (0x25),  Control_R (0x69)
    mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
    mod2        Num_Lock (0x4d)
    mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
    mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)


note that Num_Lock is for mod2

  1. we need to Remove Num_Lock from mod2 with below command in terminal

xmodmap -e "remove mod2 = Num_Lock"


pratap@i7-6550U:~$ xmodmap -e "remove Mod2 = Num_Lock"

since we removed Num_Lock from mod2 when the Num_Lock state is off, there will be no effect even we press Num_Lock here onwards.. hence its state is always off.

this command in terminal will not persist after a logout or reboot.. so add this command to startup applications like below..

enter image description here

When ever you want to operate Num_Lock key in a running session, you can run below command xmodmap -e "add mod2 = Num_Lock"

when you want to get rid of all these changes and want the default behaviour.. remove the startup command we added.


Using gsettings (front-end to dconf) in terminal:

Turn off NumLock with (copy/paste):

gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state 'off'

Remember NumLock settings with (copy/paste):

gsettings set org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state true

View those settings as required:

gsettings get org.gnome.settings-daemon.peripherals.keyboard numlock-state


gsettings get org.gnome.settings-daemon.peripherals.keyboard remember-numlock-state

On Ubuntu 20.04, apparently they changed the gsettings schema. Found the numlock settings under org.gnome.desktop (instead of org.gnome.settings-daemon)

So on 20.04, use:

gsettings set org.gnome.desktop.peripherals.keyboard numlock-state false
gsettings set org.gnome.desktop.peripherals.keyboard remember-numlock-state true

You can also use

gsettings list-recursively

to list all keys and values.

You must log in to answer this question.

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