1

On german keyboards the system shortcut for Undo is the same as on an english keyboard: command + z.

The problem: On a german keyboard layout the z key is switched with the y and as such very inconvenient to reach with left hand only. (On english keyboard it would be the same as pressing command + y - not ergonomic)

Using System Preferences > Keyboard > Shortcuts and adding a custom App Shortcut does not seem to work as command + y collides with other application shortcuts (e.g. Redo in Sublime).

So what are my options to remap the undo shortcut system-wide so that pressing command + y triggers it, without side effects?

Preferably I would not like to use third party solutions.

2 Answers 2

2

I doubt you'll manage this natively - because there is no system-wide undo/redo sequence.
Some apps use still use the older Cmd ⌘ Y , many others the newer Cmd ⌘ Shift ⇧ Z .

You can, of course, change any menu command, but you can't change a command that doesn't have a menu item. You also cannot wildcard a menu name.
Just to take an example from Safari. Cmd ⌘ Z is currently 'Undo Typing'

enter image description here

However, if I close a tab it becomes 'Undo Close Tab'

enter image description here

Once you Undo, then your Redo becomes similarly context-sensitive

enter image description here

You would have to try to make one new key command for each potential menu item & also ignore that the Keyboard prefs page is going to keep shouting at you that you have duplicates.

You might be able to get something like Karabiner Elements to globally change those specific key combinations around. There are some pre-made 'recipes' to do some fairly complex reassignments, but it's not something I've studied. See https://ke-complex-modifications.pqrs.org/#Keychron%20K6

0
0

After spending more time on this issue, I think I've found a solution: User defined macOS keyboard layouts. These allow remapping modifier combinations like command + key while leaving key untouched.

While keyboard layouts xml files can be edited manually, using Ukulele makes this process a lot less error prone.

In Ukulele create a keyboard layout from your active layout. Then keeping command pressed switch the output string for y and z:

enter image description here

Now either use Ukulele to add this keyboard layout to the active layouts or copy it to ~Library/Keyboard Layouts. After log out / log in the new layout can be selected and becomes active.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .