34 lines
904 B
TypeScript
34 lines
904 B
TypeScript
class KeystrokeModifiersAction extends KeyAction {
|
|
|
|
@assertUInt8
|
|
modifierMask: number;
|
|
|
|
_fromJsObject(jsObject: any): KeystrokeModifiersAction {
|
|
this.assertKeyActionType(jsObject);
|
|
this.modifierMask = jsObject.modifierMask;
|
|
return this;
|
|
}
|
|
|
|
_fromBinary(buffer: UhkBuffer): KeystrokeModifiersAction {
|
|
this.readAndAssertKeyActionId(buffer);
|
|
this.modifierMask = buffer.readUInt8();
|
|
return this;
|
|
}
|
|
|
|
_toJsObject(): any {
|
|
return {
|
|
keyActionType: keyActionType.KeystrokeModifiersAction,
|
|
modifierMask: this.modifierMask
|
|
};
|
|
}
|
|
|
|
_toBinary(buffer: UhkBuffer) {
|
|
buffer.writeUInt8(KeyActionId.KeystrokeModifiersAction);
|
|
buffer.writeUInt8(this.modifierMask);
|
|
}
|
|
|
|
toString(): string {
|
|
return `<KeystrokeModifiersAction modifierMask="${this.modifierMask}">`;
|
|
}
|
|
}
|