Remove input_driver_ctl
This commit is contained in:
parent
21907c77c8
commit
725c202498
|
@ -1144,7 +1144,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||||
video_driver_unset_video_cache_context();
|
video_driver_unset_video_cache_context();
|
||||||
|
|
||||||
/* Poll input to avoid possibly stale data to corrupt things. */
|
/* Poll input to avoid possibly stale data to corrupt things. */
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_POLL, NULL);
|
input_driver_poll();
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_display_set_framebuffer_dirty_flag();
|
menu_display_set_framebuffer_dirty_flag();
|
||||||
|
@ -1566,18 +1566,18 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||||
event_cmd_ctl(EVENT_CMD_REINIT, NULL);
|
event_cmd_ctl(EVENT_CMD_REINIT, NULL);
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_COMMAND_DEINIT:
|
case EVENT_CMD_COMMAND_DEINIT:
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_COMMAND_DEINIT, NULL);
|
input_driver_deinit_command();
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_COMMAND_INIT:
|
case EVENT_CMD_COMMAND_INIT:
|
||||||
event_cmd_ctl(EVENT_CMD_COMMAND_DEINIT, NULL);
|
event_cmd_ctl(EVENT_CMD_COMMAND_DEINIT, NULL);
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_COMMAND_INIT, NULL);
|
input_driver_init_command();
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_REMOTE_DEINIT:
|
case EVENT_CMD_REMOTE_DEINIT:
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_REMOTE_DEINIT, NULL);
|
input_driver_deinit_remote();
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_REMOTE_INIT:
|
case EVENT_CMD_REMOTE_INIT:
|
||||||
event_cmd_ctl(EVENT_CMD_REMOTE_DEINIT, NULL);
|
event_cmd_ctl(EVENT_CMD_REMOTE_DEINIT, NULL);
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_REMOTE_INIT, NULL);
|
input_driver_init_remote();
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_TEMPORARY_CONTENT_DEINIT:
|
case EVENT_CMD_TEMPORARY_CONTENT_DEINIT:
|
||||||
content_deinit();
|
content_deinit();
|
||||||
|
@ -1676,9 +1676,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
|
||||||
grab_mouse_state = !grab_mouse_state;
|
grab_mouse_state = !grab_mouse_state;
|
||||||
|
|
||||||
if (grab_mouse_state)
|
if (grab_mouse_state)
|
||||||
ret = input_driver_ctl(RARCH_INPUT_CTL_GRAB_MOUSE, NULL);
|
ret = input_driver_grab_mouse();
|
||||||
else
|
else
|
||||||
ret = input_driver_ctl(RARCH_INPUT_CTL_UNGRAB_MOUSE, NULL);
|
ret = input_driver_ungrab_mouse();
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
return false;
|
return false;
|
||||||
|
|
15
driver.c
15
driver.c
|
@ -223,8 +223,7 @@ static void driver_adjust_system_rates(void)
|
||||||
static void driver_set_nonblock_state(void)
|
static void driver_set_nonblock_state(void)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool enable = input_driver_ctl(
|
bool enable = input_driver_is_nonblock_state();
|
||||||
RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL);
|
|
||||||
|
|
||||||
/* Only apply non-block-state for video if we're using vsync. */
|
/* Only apply non-block-state for video if we're using vsync. */
|
||||||
if (video_driver_is_active() && video_driver_get_ptr(false))
|
if (video_driver_is_active() && video_driver_get_ptr(false))
|
||||||
|
@ -306,7 +305,7 @@ static void init_drivers(int flags)
|
||||||
if (flags & DRIVER_AUDIO)
|
if (flags & DRIVER_AUDIO)
|
||||||
audio_driver_unset_own_driver();
|
audio_driver_unset_own_driver();
|
||||||
if (flags & DRIVER_INPUT)
|
if (flags & DRIVER_INPUT)
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_OWN_DRIVER, NULL);
|
input_driver_unset_own_driver();
|
||||||
if (flags & DRIVER_CAMERA)
|
if (flags & DRIVER_CAMERA)
|
||||||
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_OWN_DRIVER, NULL);
|
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_OWN_DRIVER, NULL);
|
||||||
if (flags & DRIVER_LOCATION)
|
if (flags & DRIVER_LOCATION)
|
||||||
|
@ -363,7 +362,7 @@ static void init_drivers(int flags)
|
||||||
if (flags & (DRIVER_VIDEO | DRIVER_AUDIO))
|
if (flags & (DRIVER_VIDEO | DRIVER_AUDIO))
|
||||||
{
|
{
|
||||||
/* Keep non-throttled state as good as possible. */
|
/* Keep non-throttled state as good as possible. */
|
||||||
if (input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL))
|
if (input_driver_is_nonblock_state())
|
||||||
driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL);
|
driver_ctl(RARCH_DRIVER_CTL_SET_NONBLOCK_STATE, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -415,8 +414,8 @@ static void uninit_drivers(int flags)
|
||||||
if ((flags & DRIVER_VIDEO) && !video_driver_owns_driver())
|
if ((flags & DRIVER_VIDEO) && !video_driver_owns_driver())
|
||||||
video_driver_destroy_data();
|
video_driver_destroy_data();
|
||||||
|
|
||||||
if ((flags & DRIVER_INPUT) && !input_driver_ctl(RARCH_INPUT_CTL_OWNS_DRIVER, NULL))
|
if ((flags & DRIVER_INPUT) && !input_driver_owns_driver())
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_DESTROY_DATA, NULL);
|
input_driver_destroy_data();
|
||||||
|
|
||||||
if ((flags & DRIVER_AUDIO) && !audio_driver_owns_driver())
|
if ((flags & DRIVER_AUDIO) && !audio_driver_owns_driver())
|
||||||
audio_driver_destroy_data();
|
audio_driver_destroy_data();
|
||||||
|
@ -429,7 +428,7 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||||
case RARCH_DRIVER_CTL_DEINIT:
|
case RARCH_DRIVER_CTL_DEINIT:
|
||||||
video_driver_destroy();
|
video_driver_destroy();
|
||||||
audio_driver_destroy();
|
audio_driver_destroy();
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_DESTROY, NULL);
|
input_driver_destroy();
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_DESTROY, NULL);
|
menu_driver_ctl(RARCH_MENU_CTL_DESTROY, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -466,7 +465,7 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
|
||||||
case RARCH_DRIVER_CTL_INIT_PRE:
|
case RARCH_DRIVER_CTL_INIT_PRE:
|
||||||
audio_driver_find_driver();
|
audio_driver_find_driver();
|
||||||
video_driver_find_driver();
|
video_driver_find_driver();
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_FIND_DRIVER, NULL);
|
input_driver_find_driver();
|
||||||
camera_driver_ctl(RARCH_CAMERA_CTL_FIND_DRIVER, NULL);
|
camera_driver_ctl(RARCH_CAMERA_CTL_FIND_DRIVER, NULL);
|
||||||
find_location_driver();
|
find_location_driver();
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
|
|
@ -1056,7 +1056,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||||
uint64_t *mask = (uint64_t*)data;
|
uint64_t *mask = (uint64_t*)data;
|
||||||
|
|
||||||
RARCH_LOG("Environ GET_INPUT_DEVICE_CAPABILITIES.\n");
|
RARCH_LOG("Environ GET_INPUT_DEVICE_CAPABILITIES.\n");
|
||||||
if (input_driver_ctl(RARCH_INPUT_CTL_HAS_CAPABILITIES, NULL))
|
if (input_driver_has_capabilities())
|
||||||
*mask = input_driver_get_capabilities();
|
*mask = input_driver_get_capabilities();
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1980,7 +1980,7 @@ static bool gl_frame(void *data, const void *frame,
|
||||||
* and pause to prevent flicker. */
|
* and pause to prevent flicker. */
|
||||||
if (
|
if (
|
||||||
settings->video.black_frame_insertion
|
settings->video.black_frame_insertion
|
||||||
&& !input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL)
|
&& !input_driver_is_nonblock_state()
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
||||||
{
|
{
|
||||||
|
|
|
@ -433,7 +433,7 @@ static void init_video_input(const input_driver_t *tmp)
|
||||||
if (tmp)
|
if (tmp)
|
||||||
*input = tmp;
|
*input = tmp;
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_FIND_DRIVER, NULL);
|
input_driver_find_driver();
|
||||||
|
|
||||||
/* This should never really happen as tmp (driver.input) is always
|
/* This should never really happen as tmp (driver.input) is always
|
||||||
* found before this in find_driver_input(), or we have aborted
|
* found before this in find_driver_input(), or we have aborted
|
||||||
|
@ -441,7 +441,7 @@ static void init_video_input(const input_driver_t *tmp)
|
||||||
if (!input_get_ptr())
|
if (!input_get_ptr())
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (input_driver_ctl(RARCH_INPUT_CTL_INIT, NULL))
|
if (input_driver_init())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -511,10 +511,10 @@ static bool uninit_video_input(void)
|
||||||
video_driver_deinit_hw_context();
|
video_driver_deinit_hw_context();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!input_driver_ctl(RARCH_INPUT_CTL_OWNS_DRIVER, NULL) &&
|
!input_driver_owns_driver() &&
|
||||||
!input_driver_ctl(RARCH_INPUT_CTL_IS_DATA_PTR_SAME, video_driver_data)
|
!input_driver_is_data_ptr_same(video_driver_data)
|
||||||
)
|
)
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_DEINIT, NULL);
|
input_driver_deinit();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!video_driver_owns_driver()
|
!video_driver_owns_driver()
|
||||||
|
|
|
@ -120,7 +120,7 @@ static PyObject *py_read_input(PyObject *self, PyObject *args)
|
||||||
if (user > MAX_USERS || user < 1 || key >= RARCH_FIRST_META_KEY)
|
if (user > MAX_USERS || user < 1 || key >= RARCH_FIRST_META_KEY)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL))
|
if (!input_driver_is_libretro_input_blocked())
|
||||||
res = input_driver_state(py_binds, user - 1, RETRO_DEVICE_JOYPAD, 0, key);
|
res = input_driver_state(py_binds, user - 1, RETRO_DEVICE_JOYPAD, 0, key);
|
||||||
return PyBool_FromLong(res);
|
return PyBool_FromLong(res);
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,7 +289,7 @@ static void state_tracker_update_input(state_tracker_t *tracker)
|
||||||
input_push_analog_dpad(settings->input.autoconf_binds[i],
|
input_push_analog_dpad(settings->input.autoconf_binds[i],
|
||||||
settings->input.analog_dpad_mode[i]);
|
settings->input.analog_dpad_mode[i]);
|
||||||
|
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL))
|
if (!input_driver_is_libretro_input_blocked())
|
||||||
{
|
{
|
||||||
for (i = 4; i < 16; i++)
|
for (i = 4; i < 16; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ static void android_input_poll(void *data)
|
||||||
struct android_app *android_app = (struct android_app*)g_android;
|
struct android_app *android_app = (struct android_app*)g_android;
|
||||||
|
|
||||||
while ((ident =
|
while ((ident =
|
||||||
ALooper_pollAll((input_driver_ctl(RARCH_INPUT_CTL_KEY_PRESSED, &key))
|
ALooper_pollAll((input_driver_key_pressed(&key))
|
||||||
? -1 : 1,
|
? -1 : 1,
|
||||||
NULL, NULL, NULL)) >= 0)
|
NULL, NULL, NULL)) >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,13 +96,19 @@ struct turbo_buttons
|
||||||
|
|
||||||
static turbo_buttons_t input_driver_turbo_btns;
|
static turbo_buttons_t input_driver_turbo_btns;
|
||||||
#ifdef HAVE_COMMAND
|
#ifdef HAVE_COMMAND
|
||||||
static rarch_cmd_t *input_driver_command = NULL;
|
static rarch_cmd_t *input_driver_command = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETWORK_GAMEPAD
|
#ifdef HAVE_NETWORK_GAMEPAD
|
||||||
static rarch_remote_t *input_driver_remote = NULL;
|
static rarch_remote_t *input_driver_remote = NULL;
|
||||||
#endif
|
#endif
|
||||||
static const input_driver_t *current_input = NULL;
|
static const input_driver_t *current_input = NULL;
|
||||||
static void *current_input_data = NULL;
|
static void *current_input_data = NULL;
|
||||||
|
static bool input_driver_block_hotkey = false;
|
||||||
|
static bool input_driver_block_libretro_input = false;
|
||||||
|
static bool input_driver_osk_enabled = false;
|
||||||
|
static bool input_driver_nonblock_state = false;
|
||||||
|
static bool input_driver_flushing_input = false;
|
||||||
|
static bool input_driver_data_own = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_driver_find_handle:
|
* input_driver_find_handle:
|
||||||
|
@ -210,7 +216,7 @@ void input_driver_set(const input_driver_t **input, void **input_data)
|
||||||
*input_data = current_input_data;
|
*input_data = current_input_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_OWN_DRIVER, NULL);
|
input_driver_set_own_driver();
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_driver_keyboard_mapping_set_block(bool value)
|
void input_driver_keyboard_mapping_set_block(bool value)
|
||||||
|
@ -255,9 +261,9 @@ static retro_input_t input_driver_keys_pressed(void)
|
||||||
for (key = 0; key < RARCH_BIND_LIST_END; key++)
|
for (key = 0; key < RARCH_BIND_LIST_END; key++)
|
||||||
{
|
{
|
||||||
bool state = false;
|
bool state = false;
|
||||||
if ((!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL) && ((key < RARCH_FIRST_META_KEY)))
|
if ((!input_driver_is_libretro_input_blocked() && ((key < RARCH_FIRST_META_KEY)))
|
||||||
|| !input_driver_ctl(RARCH_INPUT_CTL_IS_HOTKEY_BLOCKED, NULL))
|
|| !input_driver_is_hotkey_blocked())
|
||||||
state = input_driver_ctl(RARCH_INPUT_CTL_KEY_PRESSED, &key);
|
state = input_driver_key_pressed(&key);
|
||||||
|
|
||||||
if (key >= RARCH_FIRST_META_KEY)
|
if (key >= RARCH_FIRST_META_KEY)
|
||||||
state |= current_input->meta_key_pressed(current_input_data, key);
|
state |= current_input->meta_key_pressed(current_input_data, key);
|
||||||
|
@ -419,7 +425,7 @@ void input_poll(void)
|
||||||
size_t i;
|
size_t i;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_POLL, NULL);
|
input_driver_poll();
|
||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
libretro_input_binds[i] = settings->input.binds[i];
|
libretro_input_binds[i] = settings->input.binds[i];
|
||||||
|
@ -472,8 +478,8 @@ int16_t input_state(unsigned port, unsigned device,
|
||||||
if (settings->input.remap_binds_enable)
|
if (settings->input.remap_binds_enable)
|
||||||
input_remapping_state(port, &device, &idx, &id);
|
input_remapping_state(port, &device, &idx, &id);
|
||||||
|
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_FLUSHING_INPUT, NULL)
|
if (!input_driver_is_flushing_input()
|
||||||
&& !input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL))
|
&& !input_driver_is_libretro_input_blocked())
|
||||||
{
|
{
|
||||||
if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD)))
|
if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD)))
|
||||||
res = current_input->input_state(
|
res = current_input->input_state(
|
||||||
|
@ -533,15 +539,14 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey)
|
||||||
&settings->input.binds[0][RARCH_ENABLE_HOTKEY];
|
&settings->input.binds[0][RARCH_ENABLE_HOTKEY];
|
||||||
const struct retro_keybind *autoconf_bind =
|
const struct retro_keybind *autoconf_bind =
|
||||||
&settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY];
|
&settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY];
|
||||||
bool kb_mapping_is_blocked = input_driver_ctl(
|
bool kb_mapping_is_blocked = input_driver_keyboard_mapping_is_blocked();
|
||||||
RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED, NULL);
|
|
||||||
|
|
||||||
/* Don't block the check to RARCH_ENABLE_HOTKEY
|
/* Don't block the check to RARCH_ENABLE_HOTKEY
|
||||||
* unless we're really supposed to. */
|
* unless we're really supposed to. */
|
||||||
if (kb_mapping_is_blocked)
|
if (kb_mapping_is_blocked)
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_HOTKEY_BLOCK, NULL);
|
input_driver_set_hotkey_block();
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_HOTKEY_BLOCK, NULL);
|
input_driver_unset_hotkey_block();
|
||||||
|
|
||||||
/* If we haven't bound anything to this,
|
/* If we haven't bound anything to this,
|
||||||
* always allow hotkeys. */
|
* always allow hotkeys. */
|
||||||
|
@ -554,9 +559,9 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey)
|
||||||
|| (autoconf_bind->joyaxis != AXIS_NONE);
|
|| (autoconf_bind->joyaxis != AXIS_NONE);
|
||||||
|
|
||||||
if (kb_mapping_is_blocked || (use_hotkey_enable && !enable_hotkey))
|
if (kb_mapping_is_blocked || (use_hotkey_enable && !enable_hotkey))
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_HOTKEY_BLOCK, NULL);
|
input_driver_set_hotkey_block();
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_HOTKEY_BLOCK, NULL);
|
input_driver_unset_hotkey_block();
|
||||||
|
|
||||||
/* If we hold ENABLE_HOTKEY button, block all libretro input to allow
|
/* If we hold ENABLE_HOTKEY button, block all libretro input to allow
|
||||||
* hotkeys to be bound to same keys as RetroPad. */
|
* hotkeys to be bound to same keys as RetroPad. */
|
||||||
|
@ -591,10 +596,10 @@ retro_input_t input_keys_pressed(void)
|
||||||
|
|
||||||
key = RARCH_ENABLE_HOTKEY;
|
key = RARCH_ENABLE_HOTKEY;
|
||||||
|
|
||||||
if (check_input_driver_block_hotkey(input_driver_ctl(RARCH_INPUT_CTL_KEY_PRESSED, &key)))
|
if (check_input_driver_block_hotkey(input_driver_key_pressed(&key)))
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_LIBRETRO_INPUT_BLOCKED, NULL);
|
input_driver_set_libretro_input_blocked();
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_LIBRETRO_INPUT_BLOCKED, NULL);
|
input_driver_unset_libretro_input_blocked();
|
||||||
|
|
||||||
for (i = 0; i < settings->input.max_users; i++)
|
for (i = 0; i < settings->input.max_users; i++)
|
||||||
{
|
{
|
||||||
|
@ -606,7 +611,7 @@ retro_input_t input_keys_pressed(void)
|
||||||
input_driver_turbo_btns.frame_enable[i] = 0;
|
input_driver_turbo_btns.frame_enable[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL))
|
if (!input_driver_is_libretro_input_blocked())
|
||||||
{
|
{
|
||||||
for (i = 0; i < settings->input.max_users; i++)
|
for (i = 0; i < settings->input.max_users; i++)
|
||||||
input_driver_turbo_btns.frame_enable[i] = input_driver_state(binds,
|
input_driver_turbo_btns.frame_enable[i] = input_driver_state(binds,
|
||||||
|
@ -634,219 +639,292 @@ void **input_driver_get_data_ptr(void)
|
||||||
return (void**)¤t_input_data;
|
return (void**)¤t_input_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool input_driver_ctl(enum rarch_input_ctl_state state, void *data)
|
bool input_driver_key_pressed(unsigned *key)
|
||||||
{
|
{
|
||||||
static bool input_driver_block_hotkey = false;
|
if (key && current_input->key_pressed)
|
||||||
static bool input_driver_block_libretro_input = false;
|
return current_input->key_pressed(current_input_data, *key);
|
||||||
static bool input_driver_osk_enabled = false;
|
return true;
|
||||||
static bool input_driver_nonblock_state = false;
|
}
|
||||||
static bool input_driver_flushing_input = false;
|
|
||||||
static bool input_driver_data_own = false;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
switch (state)
|
bool input_driver_has_capabilities(void)
|
||||||
|
{
|
||||||
|
if (!current_input->get_capabilities || !current_input_data)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_poll(void)
|
||||||
|
{
|
||||||
|
current_input->poll(current_input_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_init(void)
|
||||||
|
{
|
||||||
|
if (current_input)
|
||||||
|
current_input_data = current_input->init();
|
||||||
|
|
||||||
|
if (!current_input_data)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_deinit(void)
|
||||||
|
{
|
||||||
|
if (current_input && current_input->free)
|
||||||
|
current_input->free(current_input_data);
|
||||||
|
current_input_data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_destroy_data(void)
|
||||||
|
{
|
||||||
|
current_input_data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_destroy(void)
|
||||||
|
{
|
||||||
|
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_DESTROY, NULL);
|
||||||
|
input_driver_block_hotkey = false;
|
||||||
|
input_driver_block_libretro_input = false;
|
||||||
|
input_driver_nonblock_state = false;
|
||||||
|
input_driver_flushing_input = false;
|
||||||
|
input_driver_data_own = false;
|
||||||
|
memset(&input_driver_turbo_btns, 0, sizeof(turbo_buttons_t));
|
||||||
|
current_input = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_grab_stdin(void)
|
||||||
|
{
|
||||||
|
if (!current_input->grab_stdin)
|
||||||
|
return false;
|
||||||
|
return current_input->grab_stdin(current_input_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_keyboard_mapping_is_blocked(void)
|
||||||
|
{
|
||||||
|
if (!current_input->keyboard_mapping_is_blocked)
|
||||||
|
return false;
|
||||||
|
return current_input->keyboard_mapping_is_blocked(
|
||||||
|
current_input_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_find_driver(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
driver_ctx_info_t drv;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
drv.label = "input_driver";
|
||||||
|
drv.s = settings->input.driver;
|
||||||
|
|
||||||
|
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
||||||
|
|
||||||
|
i = drv.len;
|
||||||
|
|
||||||
|
if (i >= 0)
|
||||||
|
current_input = (const input_driver_t*)
|
||||||
|
input_driver_find_handle(i);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
case RARCH_INPUT_CTL_KEY_PRESSED:
|
unsigned d;
|
||||||
{
|
RARCH_ERR("Couldn't find any input driver named \"%s\"\n",
|
||||||
unsigned *key = (unsigned*)data;
|
settings->input.driver);
|
||||||
if (key && current_input->key_pressed)
|
RARCH_LOG_OUTPUT("Available input drivers are:\n");
|
||||||
return current_input->key_pressed(current_input_data, *key);
|
for (d = 0; input_driver_find_handle(d); d++)
|
||||||
}
|
RARCH_LOG_OUTPUT("\t%s\n", input_driver_find_ident(d));
|
||||||
return false;
|
RARCH_WARN("Going to default to first input driver...\n");
|
||||||
case RARCH_INPUT_CTL_HAS_CAPABILITIES:
|
|
||||||
if (!current_input->get_capabilities || !current_input_data)
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_POLL:
|
|
||||||
current_input->poll(current_input_data);
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_INIT:
|
|
||||||
if (current_input)
|
|
||||||
current_input_data = current_input->init();
|
|
||||||
|
|
||||||
if (!current_input_data)
|
current_input = (const input_driver_t*)
|
||||||
return false;
|
input_driver_find_handle(0);
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_DEINIT:
|
|
||||||
if (current_input && current_input->free)
|
|
||||||
current_input->free(current_input_data);
|
|
||||||
current_input_data = NULL;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_DESTROY_DATA:
|
|
||||||
current_input_data = NULL;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_DESTROY:
|
|
||||||
input_keyboard_ctl(RARCH_INPUT_KEYBOARD_CTL_DESTROY, NULL);
|
|
||||||
input_driver_block_hotkey = false;
|
|
||||||
input_driver_block_libretro_input = false;
|
|
||||||
input_driver_nonblock_state = false;
|
|
||||||
input_driver_flushing_input = false;
|
|
||||||
input_driver_data_own = false;
|
|
||||||
memset(&input_driver_turbo_btns, 0, sizeof(turbo_buttons_t));
|
|
||||||
current_input = NULL;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_GRAB_STDIN:
|
|
||||||
if (!current_input->grab_stdin)
|
|
||||||
return false;
|
|
||||||
return current_input->grab_stdin(current_input_data);
|
|
||||||
case RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED:
|
|
||||||
if (!current_input->keyboard_mapping_is_blocked)
|
|
||||||
return false;
|
|
||||||
return current_input->keyboard_mapping_is_blocked(
|
|
||||||
current_input_data);
|
|
||||||
case RARCH_INPUT_CTL_FIND_DRIVER:
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
driver_ctx_info_t drv;
|
|
||||||
|
|
||||||
drv.label = "input_driver";
|
if (current_input)
|
||||||
drv.s = settings->input.driver;
|
return true;
|
||||||
|
retro_fail(1, "find_input_driver()");
|
||||||
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
|
return false;
|
||||||
|
|
||||||
i = drv.len;
|
|
||||||
|
|
||||||
if (i >= 0)
|
|
||||||
current_input = (const input_driver_t*)
|
|
||||||
input_driver_find_handle(i);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unsigned d;
|
|
||||||
RARCH_ERR("Couldn't find any input driver named \"%s\"\n",
|
|
||||||
settings->input.driver);
|
|
||||||
RARCH_LOG_OUTPUT("Available input drivers are:\n");
|
|
||||||
for (d = 0; input_driver_find_handle(d); d++)
|
|
||||||
RARCH_LOG_OUTPUT("\t%s\n", input_driver_find_ident(d));
|
|
||||||
RARCH_WARN("Going to default to first input driver...\n");
|
|
||||||
|
|
||||||
current_input = (const input_driver_t*)
|
|
||||||
input_driver_find_handle(0);
|
|
||||||
|
|
||||||
if (current_input)
|
|
||||||
return true;
|
|
||||||
retro_fail(1, "find_input_driver()");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_SET_FLUSHING_INPUT:
|
|
||||||
input_driver_flushing_input = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_FLUSHING_INPUT:
|
|
||||||
input_driver_flushing_input = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_FLUSHING_INPUT:
|
|
||||||
return input_driver_flushing_input;
|
|
||||||
case RARCH_INPUT_CTL_SET_HOTKEY_BLOCK:
|
|
||||||
input_driver_block_hotkey = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_HOTKEY_BLOCK:
|
|
||||||
input_driver_block_hotkey = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_HOTKEY_BLOCKED:
|
|
||||||
return input_driver_block_hotkey;
|
|
||||||
case RARCH_INPUT_CTL_SET_LIBRETRO_INPUT_BLOCKED:
|
|
||||||
input_driver_block_libretro_input = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_LIBRETRO_INPUT_BLOCKED:
|
|
||||||
input_driver_block_libretro_input = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED:
|
|
||||||
return input_driver_block_libretro_input;
|
|
||||||
case RARCH_INPUT_CTL_SET_NONBLOCK_STATE:
|
|
||||||
input_driver_nonblock_state = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_NONBLOCK_STATE:
|
|
||||||
input_driver_nonblock_state = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_NONBLOCK_STATE:
|
|
||||||
return input_driver_nonblock_state;
|
|
||||||
case RARCH_INPUT_CTL_SET_OWN_DRIVER:
|
|
||||||
input_driver_data_own = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_OWN_DRIVER:
|
|
||||||
input_driver_data_own = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_OWNS_DRIVER:
|
|
||||||
return input_driver_data_own;
|
|
||||||
case RARCH_INPUT_CTL_SET_OSK_ENABLED:
|
|
||||||
input_driver_osk_enabled = true;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNSET_OSK_ENABLED:
|
|
||||||
input_driver_osk_enabled = false;
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_OSK_ENABLED:
|
|
||||||
return input_driver_osk_enabled;
|
|
||||||
case RARCH_INPUT_CTL_COMMAND_INIT:
|
|
||||||
#ifdef HAVE_COMMAND
|
|
||||||
if (!settings->stdin_cmd_enable && !settings->network_cmd_enable)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (settings->stdin_cmd_enable
|
|
||||||
&& input_driver_ctl(RARCH_INPUT_CTL_GRAB_STDIN, NULL))
|
|
||||||
{
|
|
||||||
RARCH_WARN("stdin command interface is desired, but input driver has already claimed stdin.\n"
|
|
||||||
"Cannot use this command interface.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
input_driver_command = rarch_cmd_new(settings->stdin_cmd_enable
|
|
||||||
&& !input_driver_ctl(RARCH_INPUT_CTL_GRAB_STDIN, NULL),
|
|
||||||
settings->network_cmd_enable, settings->network_cmd_port);
|
|
||||||
|
|
||||||
if (!input_driver_command)
|
|
||||||
{
|
|
||||||
RARCH_ERR("Failed to initialize command interface.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_COMMAND_DEINIT:
|
|
||||||
#ifdef HAVE_COMMAND
|
|
||||||
if (input_driver_command)
|
|
||||||
rarch_cmd_free(input_driver_command);
|
|
||||||
input_driver_command = NULL;
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_REMOTE_DEINIT:
|
|
||||||
#ifdef HAVE_NETWORK_GAMEPAD
|
|
||||||
if (input_driver_remote)
|
|
||||||
rarch_remote_free(input_driver_remote);
|
|
||||||
input_driver_remote = NULL;
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_REMOTE_INIT:
|
|
||||||
#ifdef HAVE_NETWORK_GAMEPAD
|
|
||||||
if (settings->network_remote_enable)
|
|
||||||
{
|
|
||||||
input_driver_remote
|
|
||||||
= rarch_remote_new(settings->network_remote_base_port);
|
|
||||||
|
|
||||||
if (!input_driver_remote)
|
|
||||||
{
|
|
||||||
RARCH_ERR("Failed to initialize remote gamepad interface.\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_GRAB_MOUSE:
|
|
||||||
if (!current_input || !current_input->grab_mouse)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
current_input->grab_mouse(current_input_data, true);
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_UNGRAB_MOUSE:
|
|
||||||
if (!current_input || !current_input->grab_mouse)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
current_input->grab_mouse(current_input_data, false);
|
|
||||||
break;
|
|
||||||
case RARCH_INPUT_CTL_IS_DATA_PTR_SAME:
|
|
||||||
return (current_input_data == data);
|
|
||||||
case RARCH_INPUT_CTL_NONE:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void input_driver_set_flushing_input(void)
|
||||||
|
{
|
||||||
|
input_driver_flushing_input = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_flushing_input(void)
|
||||||
|
{
|
||||||
|
input_driver_flushing_input = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_flushing_input(void)
|
||||||
|
{
|
||||||
|
return input_driver_flushing_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_set_hotkey_block(void)
|
||||||
|
{
|
||||||
|
input_driver_block_hotkey = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_hotkey_block(void)
|
||||||
|
{
|
||||||
|
input_driver_block_hotkey = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_hotkey_blocked(void)
|
||||||
|
{
|
||||||
|
return input_driver_block_hotkey;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_set_libretro_input_blocked(void)
|
||||||
|
{
|
||||||
|
input_driver_block_libretro_input = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_libretro_input_blocked(void)
|
||||||
|
{
|
||||||
|
input_driver_block_libretro_input = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_libretro_input_blocked(void)
|
||||||
|
{
|
||||||
|
return input_driver_block_libretro_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_set_nonblock_state(void)
|
||||||
|
{
|
||||||
|
input_driver_nonblock_state = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_nonblock_state(void)
|
||||||
|
{
|
||||||
|
input_driver_nonblock_state = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_nonblock_state(void)
|
||||||
|
{
|
||||||
|
return input_driver_nonblock_state;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_set_own_driver(void)
|
||||||
|
{
|
||||||
|
input_driver_data_own = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_own_driver(void)
|
||||||
|
{
|
||||||
|
input_driver_data_own = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_owns_driver(void)
|
||||||
|
{
|
||||||
|
return input_driver_data_own;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_set_onscreen_keyboard_enabled(void)
|
||||||
|
{
|
||||||
|
input_driver_osk_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_unset_onscreen_keyboard_enabled(void)
|
||||||
|
{
|
||||||
|
input_driver_osk_enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_onscreen_keyboard_enabled(void)
|
||||||
|
{
|
||||||
|
return input_driver_osk_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_init_command(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_COMMAND
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
if (!settings->stdin_cmd_enable && !settings->network_cmd_enable)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (settings->stdin_cmd_enable
|
||||||
|
&& input_driver_grab_stdin())
|
||||||
|
{
|
||||||
|
RARCH_WARN("stdin command interface is desired, but input driver has already claimed stdin.\n"
|
||||||
|
"Cannot use this command interface.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
input_driver_command = rarch_cmd_new(settings->stdin_cmd_enable
|
||||||
|
&& !input_driver_grab_stdin(),
|
||||||
|
settings->network_cmd_enable, settings->network_cmd_port);
|
||||||
|
|
||||||
|
if (!input_driver_command)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Failed to initialize command interface.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_deinit_command(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_COMMAND
|
||||||
|
if (input_driver_command)
|
||||||
|
rarch_cmd_free(input_driver_command);
|
||||||
|
input_driver_command = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void input_driver_deinit_remote(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETWORK_GAMEPAD
|
||||||
|
if (input_driver_remote)
|
||||||
|
rarch_remote_free(input_driver_remote);
|
||||||
|
input_driver_remote = NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_init_remote(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETWORK_GAMEPAD
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (!settings->network_remote_enable)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
input_driver_remote
|
||||||
|
= rarch_remote_new(settings->network_remote_base_port);
|
||||||
|
|
||||||
|
if (!input_driver_remote)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Failed to initialize remote gamepad interface.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_grab_mouse(void)
|
||||||
|
{
|
||||||
|
if (!current_input || !current_input->grab_mouse)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
current_input->grab_mouse(current_input_data, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_ungrab_mouse(void)
|
||||||
|
{
|
||||||
|
if (!current_input || !current_input->grab_mouse)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
current_input->grab_mouse(current_input_data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool input_driver_is_data_ptr_same(void *data)
|
||||||
|
{
|
||||||
|
return (current_input_data == data);
|
||||||
|
}
|
||||||
|
|
|
@ -45,46 +45,6 @@ enum input_device_type
|
||||||
INPUT_DEVICE_TYPE_JOYPAD
|
INPUT_DEVICE_TYPE_JOYPAD
|
||||||
};
|
};
|
||||||
|
|
||||||
enum rarch_input_ctl_state
|
|
||||||
{
|
|
||||||
RARCH_INPUT_CTL_NONE = 0,
|
|
||||||
RARCH_INPUT_CTL_INIT,
|
|
||||||
RARCH_INPUT_CTL_DEINIT,
|
|
||||||
RARCH_INPUT_CTL_DESTROY,
|
|
||||||
RARCH_INPUT_CTL_DESTROY_DATA,
|
|
||||||
RARCH_INPUT_CTL_HAS_CAPABILITIES,
|
|
||||||
RARCH_INPUT_CTL_POLL,
|
|
||||||
RARCH_INPUT_CTL_FIND_DRIVER,
|
|
||||||
RARCH_INPUT_CTL_GRAB_STDIN,
|
|
||||||
RARCH_INPUT_CTL_KB_MAPPING_IS_BLOCKED,
|
|
||||||
RARCH_INPUT_CTL_SET_FLUSHING_INPUT,
|
|
||||||
RARCH_INPUT_CTL_UNSET_FLUSHING_INPUT,
|
|
||||||
RARCH_INPUT_CTL_IS_FLUSHING_INPUT,
|
|
||||||
RARCH_INPUT_CTL_SET_HOTKEY_BLOCK,
|
|
||||||
RARCH_INPUT_CTL_UNSET_HOTKEY_BLOCK,
|
|
||||||
RARCH_INPUT_CTL_IS_HOTKEY_BLOCKED,
|
|
||||||
RARCH_INPUT_CTL_SET_LIBRETRO_INPUT_BLOCKED,
|
|
||||||
RARCH_INPUT_CTL_UNSET_LIBRETRO_INPUT_BLOCKED,
|
|
||||||
RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED,
|
|
||||||
RARCH_INPUT_CTL_SET_NONBLOCK_STATE,
|
|
||||||
RARCH_INPUT_CTL_UNSET_NONBLOCK_STATE,
|
|
||||||
RARCH_INPUT_CTL_IS_NONBLOCK_STATE,
|
|
||||||
RARCH_INPUT_CTL_SET_OWN_DRIVER,
|
|
||||||
RARCH_INPUT_CTL_UNSET_OWN_DRIVER,
|
|
||||||
RARCH_INPUT_CTL_OWNS_DRIVER,
|
|
||||||
RARCH_INPUT_CTL_SET_OSK_ENABLED,
|
|
||||||
RARCH_INPUT_CTL_UNSET_OSK_ENABLED,
|
|
||||||
RARCH_INPUT_CTL_IS_OSK_ENABLED,
|
|
||||||
RARCH_INPUT_CTL_COMMAND_INIT,
|
|
||||||
RARCH_INPUT_CTL_COMMAND_DEINIT,
|
|
||||||
RARCH_INPUT_CTL_REMOTE_INIT,
|
|
||||||
RARCH_INPUT_CTL_REMOTE_DEINIT,
|
|
||||||
RARCH_INPUT_CTL_KEY_PRESSED,
|
|
||||||
RARCH_INPUT_CTL_GRAB_MOUSE,
|
|
||||||
RARCH_INPUT_CTL_UNGRAB_MOUSE,
|
|
||||||
RARCH_INPUT_CTL_IS_DATA_PTR_SAME
|
|
||||||
};
|
|
||||||
|
|
||||||
struct retro_keybind
|
struct retro_keybind
|
||||||
{
|
{
|
||||||
bool valid;
|
bool valid;
|
||||||
|
@ -132,24 +92,6 @@ typedef struct input_driver
|
||||||
void (*keyboard_mapping_set_block)(void *data, bool value);
|
void (*keyboard_mapping_set_block)(void *data, bool value);
|
||||||
} input_driver_t;
|
} input_driver_t;
|
||||||
|
|
||||||
extern input_driver_t input_android;
|
|
||||||
extern input_driver_t input_sdl;
|
|
||||||
extern input_driver_t input_dinput;
|
|
||||||
extern input_driver_t input_x;
|
|
||||||
extern input_driver_t input_wayland;
|
|
||||||
extern input_driver_t input_ps3;
|
|
||||||
extern input_driver_t input_psp;
|
|
||||||
extern input_driver_t input_ctr;
|
|
||||||
extern input_driver_t input_xenon360;
|
|
||||||
extern input_driver_t input_gx;
|
|
||||||
extern input_driver_t input_xinput;
|
|
||||||
extern input_driver_t input_linuxraw;
|
|
||||||
extern input_driver_t input_udev;
|
|
||||||
extern input_driver_t input_cocoa;
|
|
||||||
extern input_driver_t input_qnx;
|
|
||||||
extern input_driver_t input_rwebinput;
|
|
||||||
extern input_driver_t input_null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_driver_find_handle:
|
* input_driver_find_handle:
|
||||||
* @index : index of driver to get handle to.
|
* @index : index of driver to get handle to.
|
||||||
|
@ -279,8 +221,6 @@ int16_t input_state(unsigned port, unsigned device,
|
||||||
|
|
||||||
retro_input_t input_keys_pressed(void);
|
retro_input_t input_keys_pressed(void);
|
||||||
|
|
||||||
bool input_driver_ctl(enum rarch_input_ctl_state state, void *data);
|
|
||||||
|
|
||||||
void *input_driver_get_data(void);
|
void *input_driver_get_data(void);
|
||||||
|
|
||||||
const input_driver_t *input_get_ptr(void);
|
const input_driver_t *input_get_ptr(void);
|
||||||
|
@ -289,8 +229,96 @@ const input_driver_t **input_get_double_ptr(void);
|
||||||
|
|
||||||
void **input_driver_get_data_ptr(void);
|
void **input_driver_get_data_ptr(void);
|
||||||
|
|
||||||
|
bool input_driver_key_pressed(unsigned *key);
|
||||||
|
|
||||||
|
bool input_driver_has_capabilities(void);
|
||||||
|
|
||||||
|
void input_driver_poll(void);
|
||||||
|
|
||||||
|
bool input_driver_init(void);
|
||||||
|
|
||||||
|
void input_driver_deinit(void);
|
||||||
|
|
||||||
|
void input_driver_destroy_data(void);
|
||||||
|
|
||||||
|
void input_driver_destroy(void);
|
||||||
|
|
||||||
|
bool input_driver_grab_stdin(void);
|
||||||
|
|
||||||
|
bool input_driver_keyboard_mapping_is_blocked(void);
|
||||||
|
|
||||||
|
bool input_driver_find_driver(void);
|
||||||
|
|
||||||
|
void input_driver_set_flushing_input(void);
|
||||||
|
|
||||||
|
void input_driver_unset_flushing_input(void);
|
||||||
|
|
||||||
|
bool input_driver_is_flushing_input(void);
|
||||||
|
|
||||||
|
void input_driver_set_hotkey_block(void);
|
||||||
|
|
||||||
|
void input_driver_unset_hotkey_block(void);
|
||||||
|
|
||||||
|
bool input_driver_is_hotkey_blocked(void);
|
||||||
|
|
||||||
|
void input_driver_set_libretro_input_blocked(void);
|
||||||
|
|
||||||
|
void input_driver_unset_libretro_input_blocked(void);
|
||||||
|
|
||||||
|
bool input_driver_is_libretro_input_blocked(void);
|
||||||
|
|
||||||
|
void input_driver_set_nonblock_state(void);
|
||||||
|
|
||||||
|
void input_driver_unset_nonblock_state(void);
|
||||||
|
|
||||||
|
bool input_driver_is_nonblock_state(void);
|
||||||
|
|
||||||
|
void input_driver_set_own_driver(void);
|
||||||
|
|
||||||
|
void input_driver_unset_own_driver(void);
|
||||||
|
|
||||||
|
bool input_driver_owns_driver(void);
|
||||||
|
|
||||||
|
void input_driver_set_onscreen_keyboard_enabled(void);
|
||||||
|
|
||||||
|
void input_driver_unset_onscreen_keyboard_enabled(void);
|
||||||
|
|
||||||
|
bool input_driver_is_onscreen_keyboard_enabled(void);
|
||||||
|
|
||||||
|
void input_driver_deinit_command(void);
|
||||||
|
|
||||||
|
bool input_driver_init_command(void);
|
||||||
|
|
||||||
|
void input_driver_deinit_remote(void);
|
||||||
|
|
||||||
|
bool input_driver_init_remote(void);
|
||||||
|
|
||||||
|
bool input_driver_grab_mouse(void);
|
||||||
|
|
||||||
|
bool input_driver_ungrab_mouse(void);
|
||||||
|
|
||||||
|
bool input_driver_is_data_ptr_same(void *data);
|
||||||
|
|
||||||
extern const struct retro_keybind *libretro_input_binds[MAX_USERS];
|
extern const struct retro_keybind *libretro_input_binds[MAX_USERS];
|
||||||
|
|
||||||
|
extern input_driver_t input_android;
|
||||||
|
extern input_driver_t input_sdl;
|
||||||
|
extern input_driver_t input_dinput;
|
||||||
|
extern input_driver_t input_x;
|
||||||
|
extern input_driver_t input_wayland;
|
||||||
|
extern input_driver_t input_ps3;
|
||||||
|
extern input_driver_t input_psp;
|
||||||
|
extern input_driver_t input_ctr;
|
||||||
|
extern input_driver_t input_xenon360;
|
||||||
|
extern input_driver_t input_gx;
|
||||||
|
extern input_driver_t input_xinput;
|
||||||
|
extern input_driver_t input_linuxraw;
|
||||||
|
extern input_driver_t input_udev;
|
||||||
|
extern input_driver_t input_cocoa;
|
||||||
|
extern input_driver_t input_qnx;
|
||||||
|
extern input_driver_t input_rwebinput;
|
||||||
|
extern input_driver_t input_null;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,23 +43,6 @@ struct rarch_joypad_driver
|
||||||
const char *ident;
|
const char *ident;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern input_device_driver_t dinput_joypad;
|
|
||||||
extern input_device_driver_t linuxraw_joypad;
|
|
||||||
extern input_device_driver_t parport_joypad;
|
|
||||||
extern input_device_driver_t udev_joypad;
|
|
||||||
extern input_device_driver_t xinput_joypad;
|
|
||||||
extern input_device_driver_t sdl_joypad;
|
|
||||||
extern input_device_driver_t ps3_joypad;
|
|
||||||
extern input_device_driver_t psp_joypad;
|
|
||||||
extern input_device_driver_t ctr_joypad;
|
|
||||||
extern input_device_driver_t xdk_joypad;
|
|
||||||
extern input_device_driver_t gx_joypad;
|
|
||||||
extern input_device_driver_t hid_joypad;
|
|
||||||
extern input_device_driver_t android_joypad;
|
|
||||||
extern input_device_driver_t qnx_joypad;
|
|
||||||
extern input_device_driver_t null_joypad;
|
|
||||||
extern input_device_driver_t mfi_joypad;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* joypad_driver_find_handle:
|
* joypad_driver_find_handle:
|
||||||
* @index : index of driver to get handle to.
|
* @index : index of driver to get handle to.
|
||||||
|
@ -226,6 +209,23 @@ bool input_joypad_hat_raw(const input_device_driver_t *driver,
|
||||||
const char *input_joypad_name(const input_device_driver_t *driver,
|
const char *input_joypad_name(const input_device_driver_t *driver,
|
||||||
unsigned port);
|
unsigned port);
|
||||||
|
|
||||||
|
extern input_device_driver_t dinput_joypad;
|
||||||
|
extern input_device_driver_t linuxraw_joypad;
|
||||||
|
extern input_device_driver_t parport_joypad;
|
||||||
|
extern input_device_driver_t udev_joypad;
|
||||||
|
extern input_device_driver_t xinput_joypad;
|
||||||
|
extern input_device_driver_t sdl_joypad;
|
||||||
|
extern input_device_driver_t ps3_joypad;
|
||||||
|
extern input_device_driver_t psp_joypad;
|
||||||
|
extern input_device_driver_t ctr_joypad;
|
||||||
|
extern input_device_driver_t xdk_joypad;
|
||||||
|
extern input_device_driver_t gx_joypad;
|
||||||
|
extern input_device_driver_t hid_joypad;
|
||||||
|
extern input_device_driver_t android_joypad;
|
||||||
|
extern input_device_driver_t qnx_joypad;
|
||||||
|
extern input_device_driver_t null_joypad;
|
||||||
|
extern input_device_driver_t mfi_joypad;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -548,8 +548,7 @@ static void input_overlay_loaded(void *task_data, void *user_data, const char *e
|
||||||
/* We can't display when the menu is up */
|
/* We can't display when the menu is up */
|
||||||
if (settings->input.overlay_hide_in_menu && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
|
if (settings->input.overlay_hide_in_menu && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
|
||||||
{
|
{
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_OSK_ENABLED, NULL)
|
if (!input_driver_is_onscreen_keyboard_enabled() && settings->input.overlay_enable)
|
||||||
&& settings->input.overlay_enable)
|
|
||||||
goto abort_load;
|
goto abort_load;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -573,7 +572,7 @@ static void input_overlay_loaded(void *task_data, void *user_data, const char *e
|
||||||
overlay_ptr = ol;
|
overlay_ptr = ol;
|
||||||
|
|
||||||
input_overlay_load_active(settings->input.overlay_opacity);
|
input_overlay_load_active(settings->input.overlay_opacity);
|
||||||
input_overlay_enable(input_driver_ctl(RARCH_INPUT_CTL_IS_OSK_ENABLED, NULL) ? settings->osk.enable : settings->input.overlay_enable);
|
input_overlay_enable(input_driver_is_onscreen_keyboard_enabled() ? settings->osk.enable : settings->input.overlay_enable);
|
||||||
input_overlay_set_scale_factor(settings->input.overlay_scale);
|
input_overlay_set_scale_factor(settings->input.overlay_scale);
|
||||||
|
|
||||||
ol->next_index = (ol->index + 1) % ol->size;
|
ol->next_index = (ol->index + 1) % ol->size;
|
||||||
|
|
|
@ -271,18 +271,14 @@ bool menu_display_libretro(void)
|
||||||
|
|
||||||
if (menu_display_libretro_running())
|
if (menu_display_libretro_running())
|
||||||
{
|
{
|
||||||
bool libretro_input_is_blocked =
|
bool libretro_input_is_blocked = input_driver_is_libretro_input_blocked();
|
||||||
input_driver_ctl(
|
|
||||||
RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL);
|
|
||||||
|
|
||||||
if (!libretro_input_is_blocked)
|
if (!libretro_input_is_blocked)
|
||||||
input_driver_ctl(
|
input_driver_set_libretro_input_blocked();
|
||||||
RARCH_INPUT_CTL_SET_LIBRETRO_INPUT_BLOCKED, NULL);
|
|
||||||
|
|
||||||
core_run();
|
core_run();
|
||||||
|
|
||||||
input_driver_ctl(
|
input_driver_unset_libretro_input_blocked();
|
||||||
RARCH_INPUT_CTL_UNSET_LIBRETRO_INPUT_BLOCKED, NULL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,7 +272,7 @@ static void menu_driver_toggle(bool latch)
|
||||||
event_cmd_ctl(EVENT_CMD_AUDIO_START, NULL);
|
event_cmd_ctl(EVENT_CMD_AUDIO_START, NULL);
|
||||||
|
|
||||||
/* Prevent stray input from going to libretro core */
|
/* Prevent stray input from going to libretro core */
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
|
|
||||||
/* Restore libretro keyboard callback. */
|
/* Restore libretro keyboard callback. */
|
||||||
if (key_event && frontend_key_event)
|
if (key_event && frontend_key_event)
|
||||||
|
|
|
@ -140,7 +140,7 @@ static void menu_input_key_end_line(void)
|
||||||
menu_input_ctl(MENU_INPUT_CTL_UNSET_KEYBOARD_LABEL_SETTING, NULL);
|
menu_input_ctl(MENU_INPUT_CTL_UNSET_KEYBOARD_LABEL_SETTING, NULL);
|
||||||
|
|
||||||
/* Avoid triggering states on pressing return. */
|
/* Avoid triggering states on pressing return. */
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_input_search_cb(void *userdata, const char *str)
|
static void menu_input_search_cb(void *userdata, const char *str)
|
||||||
|
@ -599,7 +599,7 @@ static bool menu_input_key_bind_iterate(char *s, size_t len)
|
||||||
if (menu_input->binds.begin > menu_input->binds.last)
|
if (menu_input->binds.begin > menu_input->binds.last)
|
||||||
{
|
{
|
||||||
/* Avoid new binds triggering things right away. */
|
/* Avoid new binds triggering things right away. */
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
|
|
||||||
/* We won't be getting any key events, so just cancel early. */
|
/* We won't be getting any key events, so just cancel early. */
|
||||||
if (timed_out)
|
if (timed_out)
|
||||||
|
@ -619,7 +619,7 @@ static bool menu_input_key_bind_iterate(char *s, size_t len)
|
||||||
input_driver_keyboard_mapping_set_block(false);
|
input_driver_keyboard_mapping_set_block(false);
|
||||||
|
|
||||||
/* Avoid new binds triggering things right away. */
|
/* Avoid new binds triggering things right away. */
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
|
|
||||||
binds.begin++;
|
binds.begin++;
|
||||||
|
|
||||||
|
|
|
@ -135,12 +135,11 @@ static bool get_self_input_state(netplay_t *netplay)
|
||||||
{
|
{
|
||||||
uint32_t state[UDP_WORDS_PER_FRAME - 1] = {0};
|
uint32_t state[UDP_WORDS_PER_FRAME - 1] = {0};
|
||||||
struct delta_frame *ptr = &netplay->buffer[netplay->self_ptr];
|
struct delta_frame *ptr = &netplay->buffer[netplay->self_ptr];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
if (!input_driver_ctl(RARCH_INPUT_CTL_IS_LIBRETRO_INPUT_BLOCKED, NULL)
|
if (!input_driver_is_libretro_input_blocked() && netplay->frame_count > 0)
|
||||||
&& netplay->frame_count > 0)
|
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
/* First frame we always give zero input since relying on
|
/* First frame we always give zero input since relying on
|
||||||
* input from first frame screws up when we use -F 0. */
|
* input from first frame screws up when we use -F 0. */
|
||||||
|
|
30
runloop.c
30
runloop.c
|
@ -259,7 +259,7 @@ static bool runloop_cmd_get_state_menu_toggle_button_combo(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -321,17 +321,17 @@ static void check_fast_forward_button(bool fastforward_pressed,
|
||||||
*/
|
*/
|
||||||
if (fastforward_pressed)
|
if (fastforward_pressed)
|
||||||
{
|
{
|
||||||
if (input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL))
|
if (input_driver_is_nonblock_state())
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_NONBLOCK_STATE, NULL);
|
input_driver_unset_nonblock_state();
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_NONBLOCK_STATE, NULL);
|
input_driver_set_nonblock_state();
|
||||||
}
|
}
|
||||||
else if (old_hold_pressed != hold_pressed)
|
else if (old_hold_pressed != hold_pressed)
|
||||||
{
|
{
|
||||||
if (hold_pressed)
|
if (hold_pressed)
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_NONBLOCK_STATE, NULL);
|
input_driver_set_nonblock_state();
|
||||||
else
|
else
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_NONBLOCK_STATE, NULL);
|
input_driver_unset_nonblock_state();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
@ -1205,19 +1205,19 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||||
static void runloop_iterate_linefeed_overlay(settings_t *settings)
|
static void runloop_iterate_linefeed_overlay(settings_t *settings)
|
||||||
{
|
{
|
||||||
static char prev_overlay_restore = false;
|
static char prev_overlay_restore = false;
|
||||||
bool osk_enable = input_driver_ctl(RARCH_INPUT_CTL_IS_OSK_ENABLED, NULL);
|
bool osk_enable = input_driver_is_onscreen_keyboard_enabled();
|
||||||
|
|
||||||
if (osk_enable && !input_keyboard_ctl(
|
if (osk_enable && !input_keyboard_ctl(
|
||||||
RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED, NULL))
|
RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED, NULL))
|
||||||
{
|
{
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_OSK_ENABLED, NULL);
|
input_driver_unset_onscreen_keyboard_enabled();
|
||||||
prev_overlay_restore = true;
|
prev_overlay_restore = true;
|
||||||
event_cmd_ctl(EVENT_CMD_OVERLAY_DEINIT, NULL);
|
event_cmd_ctl(EVENT_CMD_OVERLAY_DEINIT, NULL);
|
||||||
}
|
}
|
||||||
else if (!osk_enable && input_keyboard_ctl(
|
else if (!osk_enable && input_keyboard_ctl(
|
||||||
RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED, NULL))
|
RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED, NULL))
|
||||||
{
|
{
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_OSK_ENABLED, NULL);
|
input_driver_set_onscreen_keyboard_enabled();
|
||||||
prev_overlay_restore = false;
|
prev_overlay_restore = false;
|
||||||
event_cmd_ctl(EVENT_CMD_OVERLAY_INIT, NULL);
|
event_cmd_ctl(EVENT_CMD_OVERLAY_INIT, NULL);
|
||||||
}
|
}
|
||||||
|
@ -1322,9 +1322,9 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
runloop_ctl(RUNLOOP_CTL_UNSET_FRAME_LIMIT, NULL);
|
runloop_ctl(RUNLOOP_CTL_UNSET_FRAME_LIMIT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input_driver_ctl(RARCH_INPUT_CTL_IS_FLUSHING_INPUT, NULL))
|
if (input_driver_is_flushing_input())
|
||||||
{
|
{
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_UNSET_FLUSHING_INPUT, NULL);
|
input_driver_unset_flushing_input();
|
||||||
if (cmd.state[0])
|
if (cmd.state[0])
|
||||||
{
|
{
|
||||||
cmd.state[0] = 0;
|
cmd.state[0] = 0;
|
||||||
|
@ -1333,7 +1333,7 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
* pause toggle to wake it up. */
|
* pause toggle to wake it up. */
|
||||||
if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
||||||
BIT64_SET(cmd.state[0], RARCH_PAUSE_TOGGLE);
|
BIT64_SET(cmd.state[0], RARCH_PAUSE_TOGGLE);
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_SET_FLUSHING_INPUT, NULL);
|
input_driver_set_flushing_input();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1345,8 +1345,8 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
retro_time_t current = retro_get_time_usec();
|
retro_time_t current = retro_get_time_usec();
|
||||||
retro_time_t delta = current - runloop_frame_time_last;
|
retro_time_t delta = current - runloop_frame_time_last;
|
||||||
bool is_locked_fps = (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) ||
|
bool is_locked_fps = (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) ||
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL)) |
|
input_driver_is_nonblock_state()) |
|
||||||
!!recording_driver_get_data_ptr();
|
!!recording_driver_get_data_ptr();
|
||||||
|
|
||||||
|
|
||||||
if (!runloop_frame_time_last || is_locked_fps)
|
if (!runloop_frame_time_last || is_locked_fps)
|
||||||
|
@ -1477,7 +1477,7 @@ int runloop_iterate(unsigned *sleep_ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((settings->video.frame_delay > 0) &&
|
if ((settings->video.frame_delay > 0) &&
|
||||||
!input_driver_ctl(RARCH_INPUT_CTL_IS_NONBLOCK_STATE, NULL))
|
!input_driver_is_nonblock_state())
|
||||||
retro_sleep(settings->video.frame_delay);
|
retro_sleep(settings->video.frame_delay);
|
||||||
|
|
||||||
core_run();
|
core_run();
|
||||||
|
|
|
@ -755,8 +755,7 @@ bool rarch_task_push_overlay_load_default(
|
||||||
retro_task_callback_t cb, void *user_data)
|
retro_task_callback_t cb, void *user_data)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool osk_enable =
|
bool osk_enable = input_driver_is_onscreen_keyboard_enabled();
|
||||||
input_driver_ctl(RARCH_INPUT_CTL_IS_OSK_ENABLED, NULL);
|
|
||||||
|
|
||||||
if (osk_enable)
|
if (osk_enable)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue