feat: show os specific modifiers for macro actions (#855)

This commit is contained in:
Róbert Kiss
2018-11-12 23:22:26 +01:00
committed by László Monda
parent 1a9bd7de83
commit 108d60a497
2 changed files with 8 additions and 1 deletions

View File

@@ -155,7 +155,7 @@ export class MacroItemComponent implements OnInit, OnChanges {
// Tap/press/release modifiers // Tap/press/release modifiers
for (let i = KeyModifiers.leftCtrl; i <= KeyModifiers.rightGui; i <<= 1) { for (let i = KeyModifiers.leftCtrl; i <= KeyModifiers.rightGui; i <<= 1) {
if (action.isModifierActive(i)) { if (action.isModifierActive(i)) {
this.title += ' ' + KeyModifiers[i]; this.title += ' ' + this.mapper.getOsSpecificModifierTextByValue(i);
} }
} }
} }

View File

@@ -175,6 +175,13 @@ export class MapperService {
]; ];
} }
public getOsSpecificModifierTextByValue(value: KeyModifiers): string {
const keyModifier = [...this.getLeftKeyModifiers(), ...this.getRightKeyModifiers()]
.find(modifier => modifier.value === value);
return (keyModifier || {text: ''}).text;
}
private initOsSpecificText(): void { private initOsSpecificText(): void {
this.osSpecificTexts = new Map<string, string>(); this.osSpecificTexts = new Map<string, string>();