You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Mac, there is SEEMINGLY no key for the COMMAND key... after some investigation, it seems to be the same keycode as the FlxKeys.WINDOWS keycode, which is 15.
/** Indicates whether the Command key is active (`true`) or inactive (`false`). Supported for Mac OS only. On Mac OS, the `commandKey` property has the same value as the `ctrlKey` property. **/publicvarcommandKey:Bool;
/** Indicates whether the Control key is active (`true`) or inactive (`false`). On Windows and Linux, this is also true when the Ctrl key is active. **/publicvarcontrolKey:Bool;
/** On Windows and Linux, indicates whether the Ctrl key is active (`true`) or inactive(`false`); On Mac OS, indicates whether either the Ctrl key or the Command key is active. **/publicvarctrlKey:Bool;
I'm wondering if there's a nice way to incorporate cleanly a way to get COMMAND off Mac, without some fussyness from trying to just use FlxKeys.WINDOWS.
Thoughts/ideas
Renaming FlxKeys.WINDOWS to something like FlxKeys.META, and having a proper comment around it describing that it's Windows key on Windows, and the COMMAND key on Mac
Incorporating something around KeyboardEvent.ctrlKey, in cases where you might want to use CTRL on Windows, AND have it sorta "auto" use COMMAND on Mac. Something like having both FlxKey.CONTROL for when you want CTRL on Win, and CONTROL on mac, AND THEN having FlxKey.CTRL for when you want to have CTRL on Win, and then uses COMMAND on mac.
Having a FlxKey.COMMAND, that only is true/properly resolves on Mac, and when compiled to windows, doesn't return?
The text was updated successfully, but these errors were encountered:
we could add var COMMAND = 15; and var CTRL = 17; with ease, with no need to only expose it when targeting the correct OS. In fact we would need to expose every key for every OS on html, anyway so let's just make something that works on the fly if needed.
I think for having an OS aware keys we would need to have a different suffix or prefix to denote them, like call them
varCTRL_KEY=
#if windows 17// CTRL
#elseif mac 15// COMMAND
#else -16// arbitrary unused number checked in FlxKeyList at runtime
#end;
or CONTROL_MOD or MOD_CONTROL, and similar for SUPER_KEY or whatever
things really get hairy when we change CONTROL from 17 to 15, tho. we would need to deprecate it for a while, remove it in a major version, and then add it back after everyone has adapted
On Mac, there is SEEMINGLY no key for the COMMAND key... after some investigation, it seems to be the same keycode as the
FlxKeys.WINDOWS
keycode, which is15
.Digging a bit further, the OpenFL class
KeyboardEvent
has some interesting bools availableI'm wondering if there's a nice way to incorporate cleanly a way to get COMMAND off Mac, without some fussyness from trying to just use
FlxKeys.WINDOWS
.Thoughts/ideas
FlxKeys.WINDOWS
to something likeFlxKeys.META
, and having a proper comment around it describing that it's Windows key on Windows, and the COMMAND key on MacKeyboardEvent.ctrlKey
, in cases where you might want to use CTRL on Windows, AND have it sorta "auto" use COMMAND on Mac. Something like having bothFlxKey.CONTROL
for when you want CTRL on Win, and CONTROL on mac, AND THEN havingFlxKey.CTRL
for when you want to have CTRL on Win, and then uses COMMAND on mac.FlxKey.COMMAND
, that only is true/properly resolves on Mac, and when compiled to windows, doesn't return?The text was updated successfully, but these errors were encountered: