Ubuntu 19.04 how to get rid of Ctrl+Alt+F7

The following method works for me on Kubuntu 18.04.2 LTS. It should work for you if you're using X (but I don't expect it to work in Wayland).

This answer reads:

You have two different keymaps. One used by your graphical environment (X) and one used by you console.

The first one is configured by xmodmap and setxkbmap. The second one is configured by loadkeys.

You can dump the first one with xmodmap and the second one with dumpkeys.

The output of xmodmap -pke (run it from within your graphical environment) contains something like

keycode  73 = F7 F7 F7 F7 F7 F7 XF86Switch_VT_7

To do what you want you need to replace XF86Switch_VT_7 with F7. Invoke

xmodmap -e 'keycode 73 = F7 F7 F7 F7 F7 F7 F7'

From now on Ctrl+Alt+F7 won't switch to VT_7. If you need to switch anyway, you can

  • bind XF86Switch_VT_7 to another keystroke,
  • or "transit" through any non-graphical console (e.g. hit Ctrl+Alt+F3) where xmodmap has no jurisdiction and Alt+F7 (or Ctrl+Alt+F7) switches to VT_7.

In my tests I confirmed I can then bind and use Ctrl+Alt+F7 in VLC. Other GUI applications should be able to use the shortcut as well.


I'm on Kubuntu 18.04.2 LTS and I can make the solution permanent by pasting

keycode 73 = F7 F7 F7 F7 F7 F7 F7

into my ~/.Xmodmap file. This works because /etc/X11/Xsession sources files from /etc/X11/Xsession.d/; one of the files is 80kubuntu-xmodmap which makes xmodmap execute $HOME/.Xmodmap (if it exists).