Merge pull request #8959 from yoshisuga/touchscreen_input_touch_count

iOS/Android: Support detecting multi-touch input
This commit is contained in:
Twinaphex 2019-06-13 00:54:20 +02:00 committed by GitHub
commit f4554ef547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -1469,6 +1469,8 @@ static int16_t android_input_state(void *data,
return (idx < android->pointer_count) && return (idx < android->pointer_count) &&
(android->pointer[idx].x != -0x8000) && (android->pointer[idx].x != -0x8000) &&
(android->pointer[idx].y != -0x8000); (android->pointer[idx].y != -0x8000);
case RETRO_DEVICE_ID_POINTER_COUNT:
return android->pointer_count;
case RARCH_DEVICE_ID_POINTER_BACK: case RARCH_DEVICE_ID_POINTER_BACK:
{ {
const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE]; const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE];
@ -1488,6 +1490,8 @@ static int16_t android_input_state(void *data,
return (idx < android->pointer_count) && return (idx < android->pointer_count) &&
(android->pointer[idx].full_x != -0x8000) && (android->pointer[idx].full_x != -0x8000) &&
(android->pointer[idx].full_y != -0x8000); (android->pointer[idx].full_y != -0x8000);
case RETRO_DEVICE_ID_POINTER_COUNT:
return android->pointer_count;
case RARCH_DEVICE_ID_POINTER_BACK: case RARCH_DEVICE_ID_POINTER_BACK:
{ {
const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE]; const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE];

View File

@ -281,6 +281,8 @@ static int16_t cocoa_pointer_state(cocoa_input_data_t *apple,
return x; return x;
case RETRO_DEVICE_ID_POINTER_Y: case RETRO_DEVICE_ID_POINTER_Y:
return y; return y;
case RETRO_DEVICE_ID_POINTER_COUNT:
return apple->touch_count;
} }
} }

View File

@ -248,6 +248,7 @@ extern "C" {
#define RETRO_DEVICE_ID_POINTER_X 0 #define RETRO_DEVICE_ID_POINTER_X 0
#define RETRO_DEVICE_ID_POINTER_Y 1 #define RETRO_DEVICE_ID_POINTER_Y 1
#define RETRO_DEVICE_ID_POINTER_PRESSED 2 #define RETRO_DEVICE_ID_POINTER_PRESSED 2
#define RETRO_DEVICE_ID_POINTER_COUNT 3
/* Returned from retro_get_region(). */ /* Returned from retro_get_region(). */
#define RETRO_REGION_NTSC 0 #define RETRO_REGION_NTSC 0