mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-30 06:43:53 +00:00
(Android) Input tweaks/cleanups
This commit is contained in:
parent
dc92db11a3
commit
8c8c3cc10b
@ -88,8 +88,9 @@ static void android_input_poll(void *data)
|
||||
|
||||
bool debug_enable = g_settings.input.debug_enable;
|
||||
struct android_app* android_app = (struct android_app*)g_android;
|
||||
uint64_t *lifecycle_state = &g_extern.lifecycle_state;
|
||||
|
||||
g_extern.lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS));
|
||||
*lifecycle_state &= ~((1ULL << RARCH_RESET) | (1ULL << RARCH_REWIND) | (1ULL << RARCH_FAST_FORWARD_KEY) | (1ULL << RARCH_FAST_FORWARD_HOLD_KEY) | (1ULL << RARCH_MUTE) | (1ULL << RARCH_SAVE_STATE_KEY) | (1ULL << RARCH_LOAD_STATE_KEY) | (1ULL << RARCH_STATE_SLOT_PLUS) | (1ULL << RARCH_STATE_SLOT_MINUS));
|
||||
|
||||
// Read all pending events.
|
||||
while (AInputQueue_hasEvents(android_app->inputQueue) > 0)
|
||||
@ -124,7 +125,7 @@ static void android_input_poll(void *data)
|
||||
|
||||
if (keycode == AKEYCODE_BACK && (source & (AINPUT_SOURCE_KEYBOARD)))
|
||||
{
|
||||
g_extern.lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
|
||||
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
|
||||
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
||||
break;
|
||||
}
|
||||
@ -138,14 +139,15 @@ static void android_input_poll(void *data)
|
||||
|
||||
if(source & ~(AINPUT_SOURCE_TOUCHSCREEN | AINPUT_SOURCE_MOUSE))
|
||||
{
|
||||
uint64_t *state_cur = &state[state_id];
|
||||
x = AMotionEvent_getX(event, motion_pointer);
|
||||
y = AMotionEvent_getY(event, motion_pointer);
|
||||
state[state_id] &= ~((1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT) | (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT) |
|
||||
*state_cur &= ~((1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT) | (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT) |
|
||||
(1ULL << RETRO_DEVICE_ID_JOYPAD_UP) | (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN));
|
||||
state[state_id] |= PRESSED_LEFT(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
state[state_id] |= PRESSED_RIGHT(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
state[state_id] |= PRESSED_UP(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
state[state_id] |= PRESSED_DOWN(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
*state_cur |= PRESSED_LEFT(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT) : 0;
|
||||
*state_cur |= PRESSED_RIGHT(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT) : 0;
|
||||
*state_cur |= PRESSED_UP(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_UP) : 0;
|
||||
*state_cur |= PRESSED_DOWN(x, y) ? (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user