Skip to content

Instantly share code, notes, and snippets.

@knazarov
Created March 9, 2021 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knazarov/3c7f1482c9904c953a39c69699c74252 to your computer and use it in GitHub Desktop.
Save knazarov/3c7f1482c9904c953a39c69699c74252 to your computer and use it in GitHub Desktop.
A qemu cocoa patch to enable right Ctrl (useful when remapping Caps Lock -> Ctrl)
diff --git a/ui/cocoa/view.m b/ui/cocoa/view.m
index a251a737322..1a2fc0e0970 100644
--- a/ui/cocoa/view.m
+++ b/ui/cocoa/view.m
@@ -645,6 +645,13 @@ - (bool) handleEventLocked:(NSEvent *)event
}
return true;
+ case kVK_RightControl:
+ if (!!(modifiers & NSEventModifierFlagControl)) {
+ [self toggleModifier:Q_KEY_CODE_CTRL_R];
+ }
+ return true;
+
+
case kVK_Option:
if (!!(modifiers & NSEventModifierFlagOption)) {
[self toggleModifier:Q_KEY_CODE_ALT];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment