Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
I don't have any specific advice, but I think, as CTRL+ALT+Fn is bound only under the X-Windows System, that the kernel won't be related to it in any way, and that you will probably be luckier trying to tweak the X11 configuration. – njsg Mar 14 '12 at 16:48
@njsg You can use the same keys to switch from X11 to a vt, and to switch back (also between vt's) - so they must be bound just the same on a vt. – Volker Siegel Jul 23 '14 at 9:49
up vote 6 down vote accepted

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

Section "ServerFlags"
    Option "DontVTSwitch" "on"

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"

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

share|improve this answer
This does not forward the combination to the window, X still catches it. – Jes Mar 14 '12 at 19:25
I did some Googling and found you need to add something else to the config file. Let me know if it works. – Sam Morris Mar 15 '12 at 11:49
After a few months of having to run Windows I have finally tested this on Lubuntu 12.04, where the IntelliJ IDEA window still does not catch the keystroke. – Jes Aug 14 '12 at 20:52
Using the two settings was both required for me, and worked for me. (on centos). ctrl-alt-f7 is now showing the usages inline in intellij :). – Rob Dawson Apr 15 '13 at 0:11
If you are using Intellij and want to use CTL+ALT+F7 for "Show usage", on Lubuntu 15.04, the default shortcut is acutally CTL+ALT+7. You would need to change it back to CTL+ALT+F7 if you want to keep consistent with other OSes. – XiaoPeng May 17 at 7:43

In Debian 8 Jessie and Ubuntu Trusty 14.04 LTS, the xbase-clients package has been replaced by a set of utilities found in the x11-xkb-utils package. The x11-xkb-utils contains the setxkbmap command.

The following invocation of the setxkbmap command disables Ctrl-Alt-Fn console/virtual terminal switching:

setxkbmap -option srvrkeys:none

To return to the previous behavior of the ctrl-alt-Fn keys, and also remove all other options, such as caps:ctrl_modifier:

setxkbmap -option ''

To print the current settings invoke setxkbmap -print.

To invoke per user, put the command in the ~/.xinitrc file.

To invoke when an Xsession starts, create a file in


such as


containing the above setxkbmap command, and make it executable with sudo chmod +x /etc/X11/Xsession.d/65srvrkeys-none.

I tested this with KDE on Ubuntu 14.04 LTS (Trusty). These settings are also available in System Settings > Input Devices > Keyboard > Advanced. If you change srvrkeys in the GUI Settings, it shows up immediately in setxkbmap and vice versa.

share|improve this answer
@glts Is this what you're looking for? – RobertL Nov 12 '15 at 18:30
Thanks, @RobertL. My hopes were high, but no, this doesn't seem to have any effect on my Debian jessie and Ubuntu 14.04 installations. Ctrl-Alt-F7 and Ctrl-Alt-F8 still switch back and forth to and from a virtual terminal. I also don't have that menu entry System Settings > Input Devices > ... Perhaps that's a KDE thing? I'm using GNOME or whatever the Ubuntu default is. – glts Nov 13 '15 at 8:48
I have tried several ways and this one was the only that works in Lubuntu 16.04, it works when I'm logged in. Do you know how to get it to work in lxdm's greeter screen? (in ubuntu with lightdm works). – J.Serra Apr 15 at 14:01

You can disable this by going to System settings -> keyboard layout -> option. under miscellaneous compatibility options check "special keys Ctrl+Alt+<key> handled in server".

I checked this and Ubuntu does not catch any combination of Ctrl+Alt+... . but still idea does not catch Ctrl+Alt+F7 and the problem still exits!!!.

share|improve this answer
You are right Ubuntu does not catch it, but I suspect that the X server does. – Jes Mar 26 '13 at 14:45
Yay! Found out that by default in Ubuntu IDEA handles Ctrl + Alt + 7 instead of F7! – o_nix Oct 30 '13 at 12:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.