v1.2.0: fixed errors with emulated mouse input when setting bindings

This commit is contained in:
Evan Debenham
2022-02-18 15:54:14 -05:00
parent 0d3d8d9c34
commit de2eb5b653
3 changed files with 7 additions and 4 deletions

View File

@@ -64,10 +64,13 @@ public class KeyEvent {
for (KeyEvent k : keyEvents){
if (KeyBindings.getActionForKey(k) == GameAction.LEFT_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.LEFT, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else if (KeyBindings.getActionForKey(k) == GameAction.RIGHT_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.RIGHT, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else if (KeyBindings.getActionForKey(k) == GameAction.MIDDLE_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.MIDDLE, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else {
keySignal.dispatch(k);
}