LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-07-2012, 06:35 AM   #1
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 285

Rep: Reputation: 69
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?
 
Old 04-10-2012, 05:51 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,685

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
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
 
1 members found this post helpful.
Old 04-10-2012, 06:12 AM   #3
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 285

Original Poster
Rep: Reputation: 69
Awesome, almost gave up on this. Will test it as soon as i home from work. Thanks!
 
Old 04-10-2012, 02:11 PM   #4
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 285

Original Poster
Rep: Reputation: 69
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/.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH Script, printing character to tty (simulating key press?) lupusarcanus Programming 3 03-20-2011 07:23 AM
Tell DHCP to not rebind its old lease. 1veedo Linux - Networking 3 06-20-2010 06:30 PM
get working Prt Src key in tty. fasz Linux - General 3 12-10-2009 02:58 PM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM
Rebind mouse button 6? jago25_98 Linux - Software 2 04-27-2004 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration