Use KeyActionId values wherever possible. Add some further value checks. Assign this.mouseAction properly.

This commit is contained in:
László Monda
2016-03-30 12:31:53 +02:00
parent 17e56fdf7c
commit 5bd6c0a8a0
6 changed files with 26 additions and 21 deletions

View File

@@ -45,9 +45,9 @@ class KeyAction {
if (TypeChecker.isScancodeValid(keyActionFirstByte)) {
return new KeystrokeAction().fromBinary(buffer);
} else if (keyActionFirstByte === MouseAction.keyActionId) {
} else if (keyActionFirstByte === KeyActionId.MouseAction) {
return new MouseAction().fromBinary(buffer);
} else if (keyActionFirstByte === NoneAction.keyActionId) {
} else if (keyActionFirstByte === KeyActionId.NoneAction) {
return new NoneAction().fromBinary(buffer);
} else {
throw 'Invalid KeyAction first byte "${keyActionFirstByte}"';