Accessing 3rd level keyboard keys with Ctrl+Alt?

Is there any way to access the 3rd level keyboard keys with Ctrl+Alt?

This is really important to me as an European programmer. Accessing { } [ ] with AltGr is a wrist killer, and it is really disruptive for my touch typing to not be able to use Ctrl+Alt.

Using other modifiers, such as left alt, is not a good option either because that will break all kinds of keyboard shortcuts that is important to my workflow.

I really hope there is a solution here, because this is a surprisingly big dealbreaker for me. This single issue might force me back to windows actually :cry:

Also, I reckon this is a widespread issue in Europe, so it’s a worthy topic of discussion.

Hi! My locale is US English so I don’t have personal experience with this, but are the settings available under System Settings > Keyboard > Key Bindings (button in the top-right) helpful in your case?

Hi, thanks for the suggestion!

No, it is unfortunately not. My system locale is US English as well, but my laptop has a keyboard with a Scandinavian layout. The layout is really awkward to navigate if I can’t use Ctrl+Alt :sweat_smile:

Ah, I looked up the layout and see the issue there - hmm, is Caps Lock an option? If not, perhaps some custom layout would be possible - I know there are several folks here who use input method tools to accommodate specific keyboard layout needs, so I’ll defer to their knowledge on that.

And sorry if this is too obvious, but I would suggest keeping some physically possible way to input Ctrl+Alt, both for regular application keyboard shortcuts but also for access to the different virtual consoles if you need them! :slight_smile:

Caps Lock is unfortunately not a good option as I frequently use it. I am fine sacrificing all other use cases for Ctrl+Alt to solve this problem.

Anyway, thank you for your help! Hopefully someone else will come around to show me the sacred scripts :slight_smile:

Solution

For anyone else landing here in the future, I found a solution that I am quite happy with. My keyboard now works exactly as it used to do on windows. Here is what I did:

  1. Install keyd from github.com/rvaiya/keyd

  2. Put the following in /etc/keyd/default.conf

[ids]
*

[control+alt]
# Remap all number keys.
# I.E: Map Ctrl+Alt+number to AltGr+number
1 = G-1
2 = G-2
3 = G-3
4 = G-4
5 = G-5
6 = G-6
7 = G-7
8 = G-8
9 = G-9
0 = G-0

# Set Ctrl+Alt++ to be ±
- = G--

# Set Ctrl+Alt+\ to be ´
= = G-=

# Set Ctrl+Alt+¨ to be ~
] = G-]
  1. Run sudo keyd reload to reload the config set.

Side note

Depending on your keyboard layout and your system locale, you might need to change the last three entries in the config file.

In my case, these entries are a bit unusual because my keyboard uses a Norwegian layout, while my system is set to a US English locale. However, the configuration works for me because the +, \ and ¨ keys on my Norwegian keyboard correspond to the same physical keys as the -, = and ] keys on an English keyboard.

If you need to mess around with these three entries, I highly recommend using keyd monitor! It helped me immensely to set up the config file.

1 Like