Make long media key macro actions work. (#621)

* Make long media key macro actions work.

* fix: macro key action mapping
This commit is contained in:
László Monda
2018-05-03 00:28:35 +02:00
committed by GitHub
parent 3d9c83f9f4
commit 2286218980
3 changed files with 29 additions and 13 deletions

View File

@@ -67,7 +67,7 @@ export class MacroKeyTabComponent extends MacroBaseComponent implements OnInit {
}
getKeyMacroAction(): KeyMacroAction {
const keyMacroAction = Object.assign(new KeyMacroAction(), this.keypressTab.toKeyAction());
const keyMacroAction = new KeyMacroAction(this.keypressTab.toKeyAction() as any);
keyMacroAction.action = this.getActionType(this.activeTab);
return keyMacroAction;
}

View File

@@ -115,7 +115,7 @@ export class KeypressTabComponent extends Tab implements OnChanges {
const scTypePair = this.toScancodeTypePair(this.selectedScancodeOption);
keystrokeAction.scancode = scTypePair[0];
if (scTypePair[1] === 'media') {
keystrokeAction.type = KeystrokeType.shortMedia;
keystrokeAction.type = keystrokeAction.scancode > 255 ? KeystrokeType.longMedia : KeystrokeType.shortMedia;
} else {
keystrokeAction.type = KeystrokeType[scTypePair[1]];
}