Ubuntu – How to disable TTY switching with alt+arrow-key shortcut

key-bindingservertty

I recently installed Ubuntu Server 16.04.2 (because most programs I use have a cli interface) and whenever I try to use (Alt+left/right arrow key) keyboard shortcut, for Weechat, the tty switches instead of the irc channels I have open. I want to keep the option to switch ttys and use just CtrlAltF1, etc. Could someone help me please? Thank you.

Best Answer


Through some research I was able to figure out what the problem is. X server is not grabbing the keyboard.
This is what I had in my /etc/X11/xorg.conf:
Section "InputDevice" Identifier "Keyboard0" Driver "evdev" Option "Device" "/dev/input/event1" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "us,us" Option "XkbVariant" "oss,bepo" Option "XkbOptions" "grp:shift_toggle,grp_led:scroll" EndSection

Add Option "GrabDevice" "True" to before the "End Section"
Worked for me on Ubuntu 18.04.1 LTS
If your xorg.conf does not exist, then just create a new section for keyboard with only the new line in it.