LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   rebind key in TTY (https://www.linuxquestions.org/questions/linux-software-2/rebind-key-in-tty-938596/)

rizzy 04-07-2012 06:35 AM

rebind key in TTY
 
Hello,
one of the keys on my laptop is dead, it is the D key. I'm getting by in X with this command:
xmodmap -e 'keycode 135=d'

This rebinds D to submenu key that i don't use.
However this only works in X. I'm trying to build minimal Arch installation where i would like to use TTY consoles as much as possible.
My question is how to rebind keys in TTY?

pan64 04-10-2012 05:51 AM

http://tldp.org/HOWTO/Keyboard-and-Console-HOWTO-5.html
see 5.2 How to tell Linux what code to generate when a key is pressed

rizzy 04-10-2012 06:12 AM

Awesome, almost gave up on this. Will test it as soon as i home from work. Thanks!

rizzy 04-10-2012 02:11 PM

I've tried the method of changing keybinds from the link, didn't work on this distro but gave me an idea to explore - create a custom keymap and load it from rc.conf. Aside from few problems it was easy enough following tips from Arch Wiki: https://wiki.archlinux.org/index.php/KEYMAP

Problems were: not all keys are loaded in TTY compared to X. My choice for alternative D, key 135, wasn't recognized so early in boot instead i had to pick a different key (CapsLock). To add to confusion xev tool is reporting X keycodes that are different from codes used in TTY so is of no use. CapsLock in X is keycode 66, in TTY it's 58. Best place to look for correct codes is in keymaps themselfs /usr/share/kbd/keymaps/i386/qwerty/.


All times are GMT -5. The time now is 02:53 AM.