Compare commits

..

2 Commits

Author SHA1 Message Date
Lea Anthony
13939d3d6b v2.0.0-alpha.37 2021-02-23 20:15:01 +11:00
Lea Anthony
552c6b8711 fix: modifiers 2021-02-23 18:57:59 +11:00
3 changed files with 8 additions and 7 deletions

View File

@@ -1,3 +1,3 @@
package main
var version = "v2.0.0-alpha.36"
var version = "v2.0.0-alpha.37"

View File

@@ -508,6 +508,7 @@ unsigned long parseModifiers(const char **modifiers) {
const char *thisModifier = modifiers[0];
int count = 0;
while( thisModifier != NULL ) {
// Determine flags
if( STREQ(thisModifier, "cmdorctrl") ) {
result |= NSEventModifierFlagCommand;
@@ -521,7 +522,7 @@ unsigned long parseModifiers(const char **modifiers) {
if( STREQ(thisModifier, "super") ) {
result |= NSEventModifierFlagCommand;
}
if( STREQ(thisModifier, "control") ) {
if( STREQ(thisModifier, "ctrl") ) {
result |= NSEventModifierFlagControl;
}
count++;

View File

@@ -10,15 +10,15 @@ type Modifier string
const (
// CmdOrCtrlKey represents Command on Mac and Control on other platforms
CmdOrCtrlKey Modifier = "CmdOrCtrl"
CmdOrCtrlKey Modifier = "cmdorctrl"
// OptionOrAltKey represents Option on Mac and Alt on other platforms
OptionOrAltKey Modifier = "OptionOrAlt"
OptionOrAltKey Modifier = "optionoralt"
// ShiftKey represents the shift key on all systems
ShiftKey Modifier = "Shift"
ShiftKey Modifier = "shift"
// SuperKey represents Command on Mac and the Windows key on the other platforms
SuperKey Modifier = "Super"
SuperKey Modifier = "super"
// ControlKey represents the control key on all systems
ControlKey Modifier = "Control"
ControlKey Modifier = "ctrl"
)
var modifierMap = map[string]Modifier{