In macOS the "Dvorak - QWERTY ⌘" keyboard layout is the same as the "Dvorak" layout but uses the QWERTY layout for interpreting shortcuts.
| Action | QWERTY | Dvorak - QWERTY ⌘ | Dvorak |
| Copy | ⌘C | ⌘C | ⌘I |
| Paste | ⌘V | ⌘V | ⌘. |
~~It does this by mapping key codes to QWERTY when the ⌘ key is held.~~
For reference, here is how the keyboard event mapping function, `UCKeyTranslate`, is used in some cross platform widget toolkits:
[[ https://github.com/GNOME/gtk/blob/v3.22.20/gdk/quartz/gdkkeys-quartz.c#L397-L401 | GTK ]]
[[ https://github.com/qt/qtbase/blob/v5.13.0/src/plugins/platforms/cocoa/qcocoakeymapper.mm#L419-L421 | qt-base ]]
[[ https://github.com/qt/qt/blob/v4.8.7/src/gui/kernel/qkeymapper_mac.cpp#L502-L521 | qt ]]
While using the "Dvorak - QWERTY ⌘" layout blender only reacts to "Dvorak" shortcuts.
This patch passes modifier (⌘, Ctrl, etc.) info for a keyboard event to the function used in macOS for mapping keyboard layouts, `UCKeyTranslate`.
This makes blender treat shortcut inputs as if the layout were set to QWERTY whilst in "Dvorak - QWERTY ⌘" as expected.