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).
Alt
-Ctrl
-Fn
switches the display to virtual screen "n", where 1-6 are plain TTY terminals and 7 is the X-Window/UI one. I assume these key combos are intercepted very early in the event chain and that the UI doesn't see them. Likewise, your graphic screen manager and desktop shell are probably intercepting otherAlt
-Ctrl
keystrokes. My rather vanilla Eclipse Neon on Ubuntu doesn't define anyAlt
-Ctrl
-Fn
key, and hasn't got manyAlt
-Ctrl
-anything
.