* 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
40 lines
875 B
TypeScript
40 lines
875 B
TypeScript
import { UhkBuffer } from '../../uhk-buffer';
|
|
import { KeyAction, KeyActionId, keyActionType } from './key-action';
|
|
|
|
/**
|
|
* NoneAction is only intended for binary serialization of undefined key actions
|
|
* DO NOT use it as a real KeyAction
|
|
*
|
|
*/
|
|
|
|
export class NoneAction extends KeyAction {
|
|
|
|
fromJsonObject(jsonObject: any): NoneAction {
|
|
this.assertKeyActionType(jsonObject);
|
|
return this;
|
|
}
|
|
|
|
fromBinary(buffer: UhkBuffer): NoneAction {
|
|
this.readAndAssertKeyActionId(buffer);
|
|
return this;
|
|
}
|
|
|
|
toJsonObject(): any {
|
|
return {
|
|
keyActionType: keyActionType.NoneAction
|
|
};
|
|
}
|
|
|
|
toBinary(buffer: UhkBuffer) {
|
|
buffer.writeUInt8(KeyActionId.NoneAction);
|
|
}
|
|
|
|
toString(): string {
|
|
return '<NoneAction>';
|
|
}
|
|
|
|
public getName(): string {
|
|
return 'NoneAction';
|
|
}
|
|
}
|