* add write-hca.js * refactor: Move config serializer into the uhk-common package * refactor: Move getTransferBuffers into the uhk-usb package * refactor: delete obsoleted classes * build: add uhk-usb build command * refactor: move eeprom transfer to uhk-usb package * fix: Fix write-hca.js * feat: load hardware config from the device and * style: fix ts lint errors * build: fix rxjs dependency resolve * test: Add jasmine unit test framework to the tet serializer * fix(user-config): A "type": "basic", properties to the "keystroke" action types * feat(usb): set chmod+x on write-hca.js * feat(usb): Create USB logger * style: Fix type * build: Add chalk to dependencies. Chalk will colorize the output
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core';
|
|
import { KeyAction } from 'uhk-common';
|
|
|
|
import { SvgKeyboardKey } from '../keys';
|
|
|
|
@Component({
|
|
selector: 'g[svg-module]',
|
|
templateUrl: './svg-module.component.html',
|
|
styleUrls: ['./svg-module.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class SvgModuleComponent {
|
|
@Input() coverages: any[];
|
|
@Input() keyboardKeys: SvgKeyboardKey[];
|
|
@Input() keyActions: KeyAction[];
|
|
@Input() selectedKey: { layerId: number, moduleId: number, keyId: number };
|
|
@Input() selected: boolean;
|
|
@Input() keybindAnimationEnabled: boolean;
|
|
@Input() capturingEnabled: boolean;
|
|
@Output() keyClick = new EventEmitter();
|
|
@Output() keyHover = new EventEmitter();
|
|
@Output() capture = new EventEmitter();
|
|
|
|
constructor() {
|
|
this.keyboardKeys = [];
|
|
}
|
|
|
|
onKeyClick(index: number, keyTarget: HTMLElement): void {
|
|
this.keyClick.emit({
|
|
index,
|
|
keyTarget
|
|
});
|
|
}
|
|
|
|
onKeyHover(index: number, event: MouseEvent, over: boolean): void {
|
|
this.keyHover.emit({
|
|
index,
|
|
event,
|
|
over
|
|
});
|
|
}
|
|
|
|
onCapture(index: number, captured: {code: number, left: boolean[], right: boolean[]}) {
|
|
this.capture.emit({
|
|
index,
|
|
captured
|
|
});
|
|
}
|
|
}
|