Touch controls wip

This commit is contained in:
Shinovon 2026-05-06 16:16:41 +05:00
parent a56793f44b
commit 7efcaf573a
2 changed files with 32 additions and 27 deletions

View file

@ -537,29 +537,6 @@ public:
}
if (aPointerEvent.iType == TPointerEvent::EButton1Down) {
// if (x < w / 3 && y > h / 4) {
// // bottom left: left stick
// activeZone[i] = 1;
// stickCenterX[i] = x;
// stickCenterY[i] = y;
// } else if (x > w * 2 / 3 && y > h / 4) {
// // bottom right: right stick
// activeZone[i] = 2;
// stickCenterX[i] = x;
// stickCenterY[i] = y;
// } else if (x > w - (w / 5) && y < h / 4) {
// // top right: enter/exit
// activeZone[i] = 3;
// virtualButtons[JOY_Y] = 1;
// } else if (x < w / 5 && y < h / 4) {
// // top left: brake
// activeZone[i] = 4;
// virtualButtons[JOY_X] = 1;
// } else {
// // gas
// activeZone[i] = 5;
// virtualButtons[JOY_B] = 1;
// }
if (y >= 0 && y <= 32) {
if (x > 40 && x < 40 + 90) {
// l1
@ -569,11 +546,11 @@ public:
// l2
activeZone[i] = JOY_L2 + 1;
virtualButtons[JOY_L2] = 1;
} else if (x > w - 40 && x < w - 40 - 90) {
} else if (x > w - 40 - 90 && x < w - 40) {
// r1
activeZone[i] = JOY_R1 + 1;
virtualButtons[JOY_R1] = 1;
} else if (x > w - 180 && x < w - 180 - 90) {
} else if (x > w - 180 - 90 && x < w - 180) {
// r2
activeZone[i] = JOY_R2 + 1;
virtualButtons[JOY_R2] = 1;
@ -620,7 +597,7 @@ public:
b = JOY_Y;
} else if (y > 155) {
b = JOY_A;
} else if (x < w / 8) {
} else if (x < w - w / 8) {
b = JOY_X;
} else {
b = JOY_B;