Control key combinations (ctrl+a, etc.) do not work in most apps with custom layout

118 views
Skip to first unread message

anon

unread,
Nov 14, 2024, 9:20:59 AM11/14/24
to Ukelele Users
Hello,

I have created a customized version of the Programmer Dvorak keyboard layout with different alt keys for my languages. I used Ukelele's default Dvorak layout as the base, since "New From Current Input Source" doesn't work.

Everything works correctly (including cmd key combinations, which I remapped) except for ctrl key combinations. In some apps, such as Firefox and iTerm, combinations like ctrl+a and ctrl+e work correctly. However, in other apps, such as Sublime Next and Appl's Notes app, ctrl key combinations do not do anything.

Originally, the layout showed blank keys when the ctrl key was held down. I assumed that this might be the reason, so I remapped all of the keys to the corresponding regular keys to match the behavior when the cmd key is held down. However, unlike with the cmd key, this did not result in shortcuts working correctly, but rather in the keys being output as though the ctrl key was not pressed at all. For example, pressing ctrl+a would output the character a instead of moving the cursor to the beginning of a line.

How can I fix control key combinations in my keyboard layout?

Thank you for your help.

Sorin Paliga

unread,
Nov 14, 2024, 9:27:35 AM11/14/24
to ukelel...@googlegroups.com
I am not sure I have understood your request.
In macOS, the modifier key with keylayouts is Option (Alt in Windows). Ctrl and Cmd (Command or Apple key) are used for other system shortcuts.
So, again if I correctly understand your issue, use Option/Alt key instead of Ctrl.


--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ukelele-users/f3a96862-ed04-4723-87be-4355daf52066n%40googlegroups.com.

anon

unread,
Nov 14, 2024, 9:42:05 AM11/14/24
to Ukelele Users
As mentioned, I am referring to control key shortcuts. The example used in the original post is that ctrl+a should the cursor to the beginning of the line. Another example is that ctrl+e should move the cursor to the end of the line.

I ended up figuring it out by copying the system Dvorak keyboard layout instead of using Ukelele's Dvorak layout and realizing that the control keys use special characters such as U+0001, U+000F, etc.

So the issue is just pebkac but I think it would make sense to have Ukelele's base keyboard layouts (QWERTY, Dvorak, etc.) have control key shortcuts set the way system keyboard layouts do.

Sorin Paliga

unread,
Nov 14, 2024, 9:47:26 AM11/14/24
to ukelel...@googlegroups.com
Now it seems clear to me. 
This happens if the original keylayout does not have these shortcuts or if something happens/is corrupted during the process of modifying the chars. If the original keylayout has the Ctrl level OK, it should behave in the same way after the changes provided that you did not modify that level. Open the two keylayouts, and go to Modifiers button, and compare them. If they are identical in the Ctrl fields, then I dunno.

Screenshot 2024-11-14 at 16.45.32.png

Gé van Gasteren

unread,
Nov 14, 2024, 9:49:36 AM11/14/24
to ukelel...@googlegroups.com
On Thu, Nov 14, 2024 at 3:21 PM anon <anon...@gmail.com> wrote:
How can I fix control key combinations in my keyboard layout?

Sorin is right, Control key combinations are not recommended, and you have already found out the hard way, why not.

Ukelele is limited in its possibilities, because keyboard layouts themselves are limited.
The alternative would be to use apps that do more than replace the System’s keyboard layout, like Keyman or Karabiner.

With the "programmer Dvorak layout", do you mean the Qwerty Command keyboard layout?
I can use the "New from current input source" command with that one:

image.png

So if you like, I can post that one for you.
I’m just wondering which macOS / Ukelele version you’re on if it doesn’t work for you.



anon

unread,
Nov 14, 2024, 10:33:22 AM11/14/24
to Ukelele Users
The file "Ukelele Dvorak" contains a screenshot of what the ctrl key layout looks like for a keyboard layout created by going File > New Keyboard Layout... and selecting Dvorak as the base keyboard layout.
The file "System Dvorak" contains a screenshot of what the ctrl key layout looks like for a keyboard layout created by selecting the macOS Dvorak layout and going File > New From Current Input Source

Base Ukelele layouts do not have ctrl keys mapped for some reason.
System Dvorak.png
Ukelele Dvorak.png

anon

unread,
Nov 14, 2024, 10:35:28 AM11/14/24
to Ukelele Users
I'm not sure what you mean when you say "Control key combinations are not recommended." ctrl+a is a standard keyboard shortcut to move to the beginning of a line. ctrl+e is a standard keyboard shortcut to move to the end of a line. These shortcuts (and other ctrl key combinations) are mapped on any keyboard layout except for the base keyboard layouts that Ukelele supplies. This is an oversight.

With the "programmer Dvorak layout", I mean the Programmer Dvorak layout. https://www.kaufmann.no/roland/dvorak/

Gé van Gasteren

unread,
Nov 14, 2024, 10:55:11 AM11/14/24
to ukelel...@googlegroups.com
What I meant to say was that control key combinations are not recommended for use in custom keyboard layouts, because the outcome is unsure.
This is because of the way macOS handles keyboard layouts, so there is nothing Ukelele can do about it.

Here’s two clippings from the user manual:

image.png

image.png


--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.

John Brownie

unread,
Nov 14, 2024, 10:55:39 AM11/14/24
to ukelel...@googlegroups.com
The reason that control key combinations are not recommended is that the combination of the control key and another key gets intercepted by a lower level than the keyboard layout, and the so-called emacs commands, which is what you are after, are applied. I’ve never used emacs (I used vi back in the days of Unix terminals), so haven’t done much for this area. But basically, the keys a-z are expected to produce code points 1-26, as I recall it.

Your experience is interesting, as I would have expected that the keyboard layout would not affect the way that the system responds, but it does seem to do so. When I have some time, I will play around with this and see what actually happens in various combinations.

John

Gé van Gasteren

unread,
Nov 14, 2024, 2:52:25 PM11/14/24
to ukelel...@googlegroups.com
On Thu, Nov 14, 2024 at 4:35 PM anon <anon...@gmail.com> wrote:
With the "programmer Dvorak layout", I mean the Programmer Dvorak layout. https://www.kaufmann.no/roland/dvorak/
 
Thanks for the link where that Programmer Dvorak Layout can be downloaded!
Without the link, I had assumed you meant one of the layouts coming with macOS.
Unfortunately, I can’t run the .pkg file (version 1.2) on my M1 Mac running Sequoia:
image.png


Off-topic:
On that same download page, there is an interesting passage:
Reply all
Reply to author
Forward
0 new messages