-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common - Add function to check if action with modifier being pressed #9594
Conversation
I was working on something to add keycombo support some time ago which include support for double tap keys, I'll bring it up to date and post it. |
_mainKeyArray params ["_mainDik", "_mainDevice"]; | ||
if ( | ||
(_mainDik == _key) | ||
&& {_mainDevice == "KEYBOARD"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&& {_mainDevice == "KEYBOARD"} | |
&& _mainDevice isEqualTo "KEYBOARD" |
If the correct casing is always returns.
And surely the lazy eval doesn't save anything with such a cheap check.
(_mainDik == _key) | ||
&& {_mainDevice == "KEYBOARD"} | ||
&& (if (_comboKeyArray isEqualTo []) then { | ||
(!_shift) && {!_ctrl} && {!_alt} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And surely the lazy eval doesn't save anything with such a cheap check.
(!_shift) && {!_ctrl} && {!_alt} | |
!_shift && !_ctrl && !_alt |
(!_shift) && {!_ctrl} && {!_alt} | ||
} else { | ||
_comboKeyArray params ["_comboDik", "_comboDevice"]; | ||
(_comboDevice == "KEYBOARD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(_comboDevice == "KEYBOARD") | |
(_comboDevice isEqualTo "KEYBOARD") |
If the correct casing is always returned.
&& {(_ctrl) isEqualTo (_comboDik in [DIK_LCONTROL,DIK_RCONTROL])} | ||
&& {(_alt) isEqualTo (_comboDik in [DIK_LALT, DIK_RALT])} | ||
}) | ||
&& {!_isDoubleTap} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&& {!_isDoubleTap} | |
&& !_isDoubleTap |
And surely the lazy eval doesn't save anything with such a cheap check.
@PabstMirror I brought my old version up to date. It can handle close to all if not all possible keycombos. I have tested various keybinds and actions, but not all. I also did several drive-by changes, such as taking 3DEN context into the button texts and replacing the string-codes with |
Closed in favor of #9659, can be reopened if necessary. |
ref https://community.bistudio.com/wiki/actionKeysEx
e.g. "teamSwitch" key is (ctrl + U)
actionKeys "TeamSwitch" = [4.87784e+008]
won't match the input from keyDown EH
not sure if there is an easier way?
addUserActionEventHandler
wasn't firing on the display