[PATCH] winemac: Allow Command to be mapped to Ctrl.

Ricky Zhou ricky at rzhou.org
Wed Sep 12 04:36:20 CDT 2018


On Tue, Sep 11, 2018 at 11:50 AM Ken Thomases <ken at codeweavers.com> wrote:
> I'm a bit confused about why you added this comment here.
>
> On the one hand, you're right that RegisterHotKey() translates Alt to Command, but that's not related to this code.  It is a bug in that, if the user has set LeftOptionIsAlt, we probably want to use optionKey for MOD_ALT in macdrv_RegisterHotKey(), either instead of cmdKey (if LeftCommandIsCtrl is set) or combined with cmdKey (if not).  If LeftCommandIsCtrl, we probably want to use cmdKey | controlKey for MOD_CONTROL.  That is, we want to register the hot key with the Mac modifiers being the same as what the user would/could type in a Wine app to get the specified Win32 modifiers.
>
> But none of the code here is related to hot keys.  It's just implementing the registry setting.
Ah, you're right, the hotkeys comment didn't make any sense here. My
intent was to clarify why rewriting Option to Alt is done by rewriting
it to Command - I've reworded the comment.

Regarding the global hotkeys bug - I unfortunately don't have a great
idea for a fix. RegisterEventHotKey does not provide a way to
distinguish between the left or right modifiers. This means that there
isn't a way to register a correct hotkey with Ctrl when
LeftCommandIsCtrl is true and RightCommandIsCtrl is false. I wonder if
it might make sense to have a separate configurable mapping for global
hotkeys (though maybe that can be done separately from this change?)

> Hmm.  If a user sets LeftCommandIsCtrl and RightCommandIsCtrl but neither of LeftOptionIsAlt nor RightOptionIsAlt, then they have no way of typing the Windows Alt key.  The Option keys will access additional characters from the keyboard layout and the Command keys will send Ctrl.  That's probably worth at least a warning message.
Added a warning.

Thanks,
Ricky



More information about the wine-devel mailing list