static retro_input_t input_driver_keys_pressed(void) { unsigned key; retro_input_t ret = 0; for (key = 0; key < RARCH_BIND_LIST_END; key++) { bool state = false; if ((!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL) && ((key < RARCH_FIRST_META_KEY))) || !input_driver_ctl(RARCH_INPUT_CTL_IS_HOTKEY_BLOCKED, NULL)) state = input_driver_ctl(RARCH_INPUT_CTL_KEY_PRESSED, &key); if (key >= RARCH_FIRST_META_KEY) state |= current_input->meta_key_pressed(current_input_data, key); #ifdef HAVE_OVERLAY state |= input_overlay_key_pressed(key); #endif #ifdef HAVE_COMMAND if (input_driver_command) state |= rarch_cmd_get(input_driver_command, key); #endif #ifdef HAVE_NETWORK_GAMEPAD if (input_driver_remote) state |= input_remote_key_pressed(key,0); #endif if (state) ret |= (UINT64_C(1) << key); } return ret; }
void input_state_remote(int16_t *ret, unsigned port, unsigned device, unsigned idx, unsigned id) { input_remote_state_t *ol_state = input_remote_get_state_ptr(); if (!ol_state) return; switch (device) { case RETRO_DEVICE_JOYPAD: if (input_remote_key_pressed(id, port)) *ret |= 1; break; case RETRO_DEVICE_ANALOG: { unsigned base = 0; if (idx == RETRO_DEVICE_INDEX_ANALOG_RIGHT) base = 2; if (id == RETRO_DEVICE_ID_ANALOG_Y) base += 1; if (ol_state && ol_state->analog[base][port]) *ret = ol_state->analog[base][port]; } break; } }
static retro_input_t input_driver_keys_pressed(void) { unsigned key; retro_input_t ret = {0}; for (key = 0; key < RARCH_BIND_LIST_END; key++) { bool state = false; if ((!input_driver_is_libretro_input_blocked() && ((key < RARCH_FIRST_META_KEY))) || !input_driver_is_hotkey_blocked()) state = input_driver_key_pressed(&key); if (key >= RARCH_FIRST_META_KEY) state |= current_input->meta_key_pressed(current_input_data, key); #ifdef HAVE_OVERLAY state |= input_overlay_key_pressed(key); #endif #ifdef HAVE_COMMAND if (input_driver_command) { command_handle_t handle; handle.handle = input_driver_command; handle.id = key; state |= command_get(&handle); } #endif #ifdef HAVE_NETWORKGAMEPAD if (input_driver_remote) state |= input_remote_key_pressed(key,0); #endif if (state) ret.state |= (UINT64_C(1) << key); } return ret; }