13

My Ctrl+Alt key combination is not recognized by my OS. My Ctrl and Alt keys both work individually. I am simply not able to use any shortcuts with Ctrl and Alt together.

I am fairly certain that something is intercepting the Ctrl+Alt command as soon as I click Alt. However, in my keyboard settings, there is nothing that uses the Ctrl+Alt hotkey. I even did a reset of all the keyboard shortcuts to be sure.

The reason why I think something is intercepting it, is that I installed some software involving switching to a Latin keyboard using the (Ctrl+Alt hotkey). And I do not know how to change this setting.

How can I fix this issue?

pomsky
  • 68,507
Luca Guarro
  • 243
  • 2
  • 8
  • For example, I would like to use the standard + + shortcut to open up a terminal. The fact of the matter is is that I cannot use any + [+ X] hotkey where X is any combination of keys. – Luca Guarro Oct 04 '18 at 12:03
  • Yes, I think that may be the case but I am unsure on how to change it. When I go to Settings --> Region & Language --> Input Sources Options, I see that the keyboard shortcut for ¨Alternative switch to next source" is set to + . It says that I can change this shortcut in the keyboard settings but I see no such option. – Luca Guarro Oct 04 '18 at 12:10

2 Answers2

10

This is a known issue with GNOME shell, shortcuts get triggered on-keypress instead of on-release (see this). Since you have Ctrl+Alt set to change the keyboard layout, whenever you attempt to press Ctrl+Alt+something, the shell registers only Ctrl+Alt immediately after you've pressed Alt and changes the layout.

You can disable this Ctrl+Alt combination using (GNOME) Tweaks. First install it by running

sudo apt install gnome-tweaks

and use the tool to disable the combination. Refer to this for details: Ubuntu 17.10 and later: can't change the input switching shortcut to alt+shift

pomsky
  • 68,507
  • It helped me a lot. Thanks! – luke Nov 26 '20 at 19:19
  • In my case, with Ubuntu 22.04 following this was not enough. I had to set the Ctrl+Alt (+ArrowUp/Down in my case) combination as Gnome shortcut for something meaningless and disable the shortcuts afterwards. This overwrites the hidden Gnome shortcut. reference1 and reference2 – Javier TG Mar 01 '24 at 11:13
1

I came looking for a solution to why some software I had installed (VS Code) couldn't register the input of my desired keys ( or ) as an addendum to the Ctrl+Alt sequence. The essential problem is the same, but the specifics of my fresh Ubuntu install (22.04 LTS) are different from what the accepted answer identifies as the solution.

Ubuntu's built-in settings Keyboard Shortcuts didn't list the shortcuts described, and neither did gnome-tweaks. Further searching around the topic of GNOME keyboard shortcuts led me to the question Ubuntu 17.10 and later: can't change the input switching shortcut to alt+shift, and the answers there put me on the right path:

The built-in command line interface for GNOMEs desktop key bindings is gsettings, stored under the schema org.gnome.desktop.wm.keybindings. You can list all of these as key-value pairs by running

gsettings list-recursively org.gnome.desktop.wm.keybindings

Scrolling through the list, I was able to find the following entries

# ...
org.gnome.desktop.wm.keybindings switch-to-workspace-down ['<Control><Alt>Down']
org.gnome.desktop.wm.keybindings switch-to-workspace-last ['<Super>End']
org.gnome.desktop.wm.keybindings switch-to-workspace-left ['<Super>Page_Up', '<Super><Alt>Left', '<Control><Alt>Left']
org.gnome.desktop.wm.keybindings switch-to-workspace-right ['<Super>Page_Down', '<Super><Alt>Right', '<Control><Alt>Right']
org.gnome.desktop.wm.keybindings switch-to-workspace-up ['<Control><Alt>Up']
# ...

To get rid of these bindings, I ran the following commands:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down '[]'
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up '[]'

The change requires restarting the session by logging out & back in order to take effect.

If any mistake is made, the settings can be reverted with

gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-down
gsettings reset org.gnome.desktop.wm.keybindings switch-to-workspace-up
Barney
  • 111
  • 3