X11 Keyboard Shortcuts – Rebinding or Disabling CTRL+ALT+F# Virtual Terminal Switching

consolekeyboard shortcutsttyvirtual-consolesx11

I have an application that binds CTRL+ALT+F7, but my linux machine seems to catch the keystroke.

Is there a way to rebind/disable this key? A recompile of the kernel is an acceptable answer.

The distributions in question are Fedora 16 and Ubuntu 11.10.

Best Answer

Place this in your /etc/X11/xorg.conf file to disable VT switching with Ctrl+Alt+Fn:

Section "ServerFlags"
    Option "DontVTSwitch" "on"
EndSection

You will also need the following to cause events to be passed through to clients connected to the display:

Section "InputClass"
    Identifier "keyboard defaults"
    MatchIsKeyboard "on"
    Option "XKbOptions" "srvrkeys:none"
EndSection

(That last bit is untested, refer to its source.)

Related Question