v1.4.0: several text input improvements for Steam Deck

This commit is contained in:
Evan Debenham
2022-08-12 11:05:28 -04:00
parent dcc84e4e7e
commit 4ae3bf9336
7 changed files with 45 additions and 27 deletions

View File

@@ -21,6 +21,7 @@
package com.watabou.input;
import com.watabou.noosa.Game;
import com.watabou.utils.Signal;
import java.util.ArrayList;
@@ -63,13 +64,13 @@ public class KeyEvent {
public static synchronized void processKeyEvents(){
for (KeyEvent k : keyEvents){
if (KeyBindings.getActionForKey(k) == GameAction.LEFT_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.LEFT, k.pressed);
Game.inputHandler.emulateTouch(PointerEvent.LEFT, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else if (KeyBindings.getActionForKey(k) == GameAction.RIGHT_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.RIGHT, k.pressed);
Game.inputHandler.emulateTouch(PointerEvent.RIGHT, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else if (KeyBindings.getActionForKey(k) == GameAction.MIDDLE_CLICK){
PointerEvent.emulateMouseButton(PointerEvent.MIDDLE, k.pressed);
Game.inputHandler.emulateTouch(PointerEvent.MIDDLE, k.pressed);
if (KeyBindings.bindingKey) keySignal.dispatch(k);
} else {
keySignal.dispatch(k);