This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch reproducible-widget-previews
in repository efl.
View the commit online.
commit febcdaadb5cc83074cdf9675a49c262282c4ccfa
Author: Cedric BAIL <[email protected]>
AuthorDate: Tue Mar 17 22:52:43 2026 -0600
ecore_cocoa: map Command to Control and Control to Super
On macOS the Command key (⌘) is the primary modifier for shortcuts,
equivalent to Ctrl on Linux/Windows. The Cocoa backend was mapping
Command to ECORE_EVENT_MODIFIER_WIN (which sets both "Super" and
"Hyper" in Evas), making it impossible to trigger any EFL shortcut
bound to Control — the standard modifier used throughout Elementary
and applications like Terminology.
Swap the mapping so that:
- Command (⌘) → ECORE_EVENT_MODIFIER_CTRL / key "Control_L"
- Control (^) → ECORE_EVENT_MODIFIER_WIN / key "Super_L"
This follows the same convention used by Qt, Electron, and other
cross-platform toolkits on macOS. Cmd+C, Cmd+V, Cmd+Shift+C etc.
now trigger the same shortcuts that Ctrl+C, Ctrl+V, Ctrl+Shift+C
would on Linux.
Made-with: Cursor
---
src/lib/ecore_cocoa/ecore_cocoa.m | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/lib/ecore_cocoa/ecore_cocoa.m b/src/lib/ecore_cocoa/ecore_cocoa.m
index ae52f24727..5b8198ac44 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa.m
@@ -102,9 +102,13 @@ ecore_cocoa_event_modifiers(NSUInteger mod)
unsigned int modifiers = 0;
if (mod & NSEventModifierFlagShift) modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
- if (mod & NSEventModifierFlagControl) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ /* Swap Command ↔ Control so that Command (⌘) acts as the primary
+ * "Control" modifier for EFL applications, matching the standard
+ * macOS convention used by Qt, Electron, and most cross-platform
+ * toolkits. The physical Control key becomes "Super". */
+ if (mod & NSEventModifierFlagCommand) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ if (mod & NSEventModifierFlagControl) modifiers |= ECORE_EVENT_MODIFIER_WIN;
if (mod & NSEventModifierFlagOption) modifiers |= ECORE_EVENT_MODIFIER_ALTGR;
- if (mod & NSEventModifierFlagCommand) modifiers |= ECORE_EVENT_MODIFIER_WIN;
if (mod & NSEventModifierFlagNumericPad) modifiers |= ECORE_EVENT_LOCK_NUM;
if (mod & NSEventModifierFlagCapsLock) modifiers |= ECORE_EVENT_LOCK_CAPS;
@@ -266,12 +270,12 @@ _ecore_cocoa_feed_events(void *anEvent)
// Turn special key flags on
if (flags & NSEventModifierFlagShift)
key = "Shift_L";
- else if (flags & NSEventModifierFlagControl)
+ else if (flags & NSEventModifierFlagCommand)
key = "Control_L";
+ else if (flags & NSEventModifierFlagControl)
+ key = "Super_L";
else if (flags & NSEventModifierFlagOption)
key = "Alt_L";
- else if (flags & NSEventModifierFlagCommand)
- key = "Super_L";
else if (flags & NSEventModifierFlagCapsLock)
key = "Caps_Lock";
else if (flags & NSEventModifierFlagNumericPad)
@@ -305,12 +309,12 @@ _ecore_cocoa_feed_events(void *anEvent)
// Turn special key flags off
if (changed_flags & NSEventModifierFlagShift)
key = "Shift_L";
- else if (changed_flags & NSEventModifierFlagControl)
+ else if (changed_flags & NSEventModifierFlagCommand)
key = "Control_L";
+ else if (changed_flags & NSEventModifierFlagControl)
+ key = "Super_L";
else if (changed_flags & NSEventModifierFlagOption)
key = "Alt_L";
- else if (changed_flags & NSEventModifierFlagCommand)
- key = "Super_L";
else if (changed_flags & NSEventModifierFlagCapsLock)
key = "Caps_Lock";
else if (changed_flags & NSEventModifierFlagNumericPad)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.