You are not logged in.
Heya,
I am Adcock.
I am having problem switching ttys using 'Alt + left/right arrow keys' when in Xorg.
I know I can use 'Ctrl+Alt+F*' but 'Alt + left/right arrow keys' would be much easier.
I can switch using 'Alt + left/right arrow keys' when in (Linux console) tty but in Xorg I can't do that.
I am using I3 WM and I do use Alt as a modifier key.
I changed the config (I3's) so that it doesn't use Alt as modifier key but, I could not switch tty using the said key combinations.
I need to either change and reconfigure linux console to use some other key for changing tty.
Or I need xorg (maybe I3) to let me use 'Alt + left/right arrow keys' to change ttys.
So how can I customize those keys?
Thanks for reading.
Here is my i3 config which I tested. (after commenting out Alt)
Last edited by Adcock (2021-02-06 15:11:51)
Offline
This is exactly how tty switch should work, you can't use Alt to change tty while you are in X, maybe you can configure your keybindings to your liking, see "man chvt"
Offline
Thanks for replying.
Okay.
But is it possible to change the key bindings for the tty (Linux Console)?
I have a solution for Xorg but I don't want to change Xorg key bindings as some of the gui programs also use 'Alt + left/right arrow keys', for example firefox, palemoon, weechat, I3 (It uses Ctrl+Alt+left/right arrow keys)....etc.
Offline
I have found a solution for changing the keys for linux console.
Orginal Answer
Temporary:
For this, one would have to create a keymap file
For me the file is :
alt Shift keycode 36 = Decr_Console
alt Shift keycode 39 = Incr_Console
alt keycode 105 = nul
alt keycode 106 = nulThis works temporarily for current session [affects all virtual consoles and will therefore outlive your session]
Last two lines just modifies alt+left/right keys so that these can't be used for changing tty.
First two lines enables user to use alt+shift+h/s (for dvorak layout) to change tty
With this same keymap a qwerty user would use alt+shift+j/; for changing tty
Then save this file to 'file_name', then run as root inside linux console :
cat file_name | loadkeysPermanent:
To make this persistent created a keymap file 'keymap-file-name.map' using 'include' as follows :
include "dvorak.map"
alt Shift keycode 36 = Decr_Console
alt Shift keycode 39 = Incr_Console
alt keycode 105 = nul
alt keycode 106 = nulHere I included dvorak.map but one should use whatever keymap they want to use.
This is done so that one doesn't have to create a totally new layout.
Compress keymap-file-name.map using gzip.
Then copy it to appropriate directory under:
/usr/share/kbd/keymaps/*One may need root permission for this.
I copied it to:
/usr/share/kbd/keymaps/i386/dvorak/Then as root run :
localectl set-keymap --no-convert keymap-file-nameTo learn more see :
man loadkeys
man dumpkeys
man keymapsIf anyone knows about any other directory where,
'localectl' can detect keymaps and where root permission is not required,
please do tell.
Last edited by Adcock (2021-01-14 20:43:38)
Offline