Because of the layout of my keyboard, I want to have numlock permanently pressed and use the numlock key as a delete key. I can't seem to get this to work. Any ideas on how to do this would be appreciated.
Edit: I am running on Ubuntu 16
Here is what I have tried:
Use Xmodmap with numlockx
Inspired by this question. My understanding is that xmodmap is deprecated, so this is probably not a great idea.
- Create a file
~/.Xmodmap
with linekeycode 77 = Delete NoSymbol
- Run
xmodmap ~/.Xmodmap
- Run
numlockx on
This allows numlock to work as delete and enables the num pad until the first time I press the numlock key. Then the numlock key disables the num pad.
Use XKB
- Edit
/usr/share/X11/xkb/symbols/us
to havekey <NMLK> { [Delete, Num_Lock] };
at the end of the basic keymap. - restart computer
also tried:
- Edit
/usr/share/X11/xkb/symbols/us
to havereplace key <NMLK> { [Delete, Num_Lock] };
at the end of the basic keymap. - restart computer
This suffers from similar problems as the other method, being able to delete works, but the numlock key turns off the numpad. It also seems to mess with other keys like the windows key when the num pad is enabled. I do like that I get control of the numlock using shift+numlock. I can't find any difference between using replace and not using it.