Android: Fix multi-touch detection

This commit is contained in:
kichikuou
2020-01-04 11:22:24 +09:00
parent 29bb5fc226
commit ea7eee836f
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -36,13 +36,12 @@ cd xsystem35-sdl2/android
## How to use
1. Create a ZIP file containing all the game files (`*.ALD`) and [configuration files](https://haniwa.technology/games/preparing-a-game-directory.html), and transfer it to your device.
2. When you start the app, a file chooser opens. Select the zip file.
3. The game starts.
3. The game starts. Two-finger touch is treated as a right click.
4. Game data persists in the app's internal storage. Use the device's Settings app if you want to clear it (eg. before installing another game).
Note that this Android port is still in early development; see below.
## TODO
- Right-click emulation
- Save / Load support
- Better launcher
- MP3 / MIDI BGM support (currently only ogg is supported)
+2 -2
View File
@@ -162,7 +162,7 @@ static void sdl_getEvent(void) {
break;
case SDL_FINGERDOWN:
if (SDL_GetNumTouchFingers(SDL_GetTouchDevice(0)) >= 2) {
if (SDL_GetNumTouchFingers(e.tfinger.touchId) >= 2) {
mouseb &= ~(1 << SDL_BUTTON_LEFT);
mouseb |= 1 << SDL_BUTTON_RIGHT;
RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE;
@@ -176,7 +176,7 @@ static void sdl_getEvent(void) {
break;
case SDL_FINGERUP:
if (SDL_GetNumTouchFingers(SDL_GetTouchDevice(0)) == 0) {
if (SDL_GetNumTouchFingers(e.tfinger.touchId) == 0) {
mouseb &= ~(1 << SDL_BUTTON_LEFT | 1 << SDL_BUTTON_RIGHT);
RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_LEFT)] = FALSE;
RawKeyInfo[mouse_to_rawkey(SDL_BUTTON_RIGHT)] = FALSE;