feat: show os specific modifiers for macro actions (#855)
This commit is contained in:
committed by
László Monda
parent
1a9bd7de83
commit
108d60a497
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user