My laptop does not have a numpad, not even those in which it is activated by the FN key.
When I was using windows, I used AutoHotkey with a script that I replaced the QWEASDZXC keys by 789456123, and if I want to disable it just need to type F12.
Is there a way to do it in linux?
Best Answer
I can think of a couple ways to do this with XKB, but it's not for the faint of heart.
Make a custom symbol option that adds your numbers to "level3" or "level5" of your chosen keys. (AltGr is the
ISO_Level3_Shift
key, used in non-US or US-intl layouts for áçćéñþëd characters.) Normally these keys act like Shift -- you'd have to hold them down while you typed the numbers. But your new option could make them act more like CapsLock if preferred. Such an option would then override your layout's default bindings for those letters to add the numbers.Make an empty layout that emits only those numbers on those keys and no other alphanumeric symbols. When loaded in as a second layout, you'd have a predefined layout-switch key and would use that to toggle between your main layout and this one. Again, the layout-switch key could be configured like a Shift (only switch layouts while held) or a CapsLock.
Either of these options can be implemented by altering system XKB files in
/usr/share/X11/xkb/{symbols,rules}
or by storing your customizations in local XKB configuration files. Changes to the system files could be wiped out by an update to thexkeyboard-config
package, but are easier to use with system layout setting tools like/etc/default/keyboard
or GNOME's settings daemon.