Additional media keys with icons (#307)

* Add missing scancodes for media keystrokes

* Use icons for media keys

* Fix media scancodes.
This commit is contained in:
József Farkas
2017-06-12 20:46:06 +02:00
committed by László Monda
parent a8a659dadd
commit 1a456c2ced
4 changed files with 130 additions and 42 deletions

View File

@@ -221,8 +221,8 @@ export class SvgKeyboardKeyComponent implements OnInit, OnChanges, OnDestroy {
if (!keyAction.hasActiveModifier() && keyAction.hasScancode()) {
const scancode: number = keyAction.scancode;
newLabelSource = this.mapper.scanCodeToText(scancode, keyAction.type);
if (this.mapper.hasScancodeIcon(scancode)) {
this.labelSource = this.mapper.scanCodeToSvgImagePath(scancode);
if (this.mapper.hasScancodeIcon(scancode, keyAction.type)) {
this.labelSource = this.mapper.scanCodeToSvgImagePath(scancode, keyAction.type);
this.labelType = LabelTypes.SingleIcon;
} else if (newLabelSource !== undefined) {
if (newLabelSource.length === 1) {

View File

@@ -141,7 +141,7 @@ export class SvgKeystrokeKeyComponent implements OnInit, OnChanges {
this.labelType = 'two-line';
}
} else {
this.labelSource = this.mapper.scanCodeToSvgImagePath(scancode);
this.labelSource = this.mapper.scanCodeToSvgImagePath(scancode, this.keystrokeAction.type);
this.labelType = 'icon';
}
} else {