v2.0.2: fixed controller drag events incorrectly using separate IDs

This commit is contained in:
Evan Debenham
2023-04-10 17:09:27 -04:00
parent 1c944a0ada
commit e995af5c95
4 changed files with 29 additions and 26 deletions

View File

@@ -79,18 +79,18 @@ public class InputHandler extends InputAdapter {
multiplexer.removeProcessor(processor);
}
public void emulateTouch(int button, boolean down){
public void emulateTouch(int id, int button, boolean down){
PointF hoverPos = PointerEvent.currentHoverPos();
if (down){
multiplexer.touchDown((int)hoverPos.x, (int)hoverPos.y, 10+button, button);
multiplexer.touchDown((int)hoverPos.x, (int)hoverPos.y, id, button);
} else {
multiplexer.touchUp((int)hoverPos.x, (int)hoverPos.y, 10+button, button);
multiplexer.touchUp((int)hoverPos.x, (int)hoverPos.y, id, button);
}
}
public void emulateDrag(int button){
public void emulateDrag(int id){
PointF hoverPos = PointerEvent.currentHoverPos();
multiplexer.touchDragged((int)hoverPos.x, (int)hoverPos.y, 10+button);
multiplexer.touchDragged((int)hoverPos.x, (int)hoverPos.y, id);
}
public void processAllEvents(){
@@ -105,7 +105,7 @@ public class InputHandler extends InputAdapter {
@Override
public synchronized boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (pointer < 10) {
if (pointer != ControllerHandler.CONTROLLER_POINTER_ID) {
ControllerHandler.setControllerPointer(false);
ControllerHandler.controllerActive = false;
}