mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Get rid of last param to keyboard_input_event
This commit is contained in:
parent
f35b5924e1
commit
ed7da3f632
@ -173,8 +173,7 @@ static void rwebinput_input_poll(void *data)
|
|||||||
{
|
{
|
||||||
if (diff & 1)
|
if (diff & 1)
|
||||||
input_keyboard_event((state->keys[i] & (1 << k)) != 0,
|
input_keyboard_event((state->keys[i] & (1 << k)) != 0,
|
||||||
input_keymaps_translate_keysym_to_rk(i * 8 + k), 0, 0,
|
input_keymaps_translate_keysym_to_rk(i * 8 + k), 0, 0);
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ static void sdl_input_poll(void *data)
|
|||||||
if (event.key.keysym.mod & KMOD_CAPS)
|
if (event.key.keysym.mod & KMOD_CAPS)
|
||||||
mod |= RETROKMOD_CAPSLOCK;
|
mod |= RETROKMOD_CAPSLOCK;
|
||||||
|
|
||||||
input_keyboard_event(event.type == SDL_KEYDOWN, code, code, mod, false);
|
input_keyboard_event(event.type == SDL_KEYDOWN, code, code, mod);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
else if (event.type == SDL_MOUSEWHEEL)
|
else if (event.type == SDL_MOUSEWHEEL)
|
||||||
|
@ -122,9 +122,9 @@ void x11_handle_key_event(XEvent *event, XIC ic, bool filter)
|
|||||||
if (state & Mod4Mask)
|
if (state & Mod4Mask)
|
||||||
mod |= RETROKMOD_META;
|
mod |= RETROKMOD_META;
|
||||||
|
|
||||||
input_keyboard_event(down, key, chars[0], mod, false);
|
input_keyboard_event(down, key, chars[0], mod);
|
||||||
|
|
||||||
for (i = 1; i < num; i++)
|
for (i = 1; i < num; i++)
|
||||||
input_keyboard_event(down, RETROK_UNKNOWN,
|
input_keyboard_event(down, RETROK_UNKNOWN,
|
||||||
chars[i], mod, false);
|
chars[i], mod);
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ void handle_xkb(
|
|||||||
}
|
}
|
||||||
|
|
||||||
input_keyboard_event(value, input_keymaps_translate_keysym_to_rk(code),
|
input_keyboard_event(value, input_keymaps_translate_keysym_to_rk(code),
|
||||||
num_syms ? xkb_keysym_to_utf32(syms[0]) : 0, mod, false);
|
num_syms ? xkb_keysym_to_utf32(syms[0]) : 0, mod);
|
||||||
|
|
||||||
for (i = 1; i < num_syms; i++)
|
for (i = 1; i < num_syms; i++)
|
||||||
input_keyboard_event(value, RETROK_UNKNOWN,
|
input_keyboard_event(value, RETROK_UNKNOWN,
|
||||||
xkb_keysym_to_utf32(syms[i]), mod, false);
|
xkb_keysym_to_utf32(syms[i]), mod);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,13 @@ struct input_keyboard_line
|
|||||||
void *userdata;
|
void *userdata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void input_keyboard_line_toggle_osk(bool enable)
|
||||||
|
{
|
||||||
|
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
||||||
|
driver.osk_active = enable;
|
||||||
|
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_keyboard_line_free:
|
* input_keyboard_line_free:
|
||||||
* @state : Input keyboard line handle.
|
* @state : Input keyboard line handle.
|
||||||
@ -51,8 +58,7 @@ void input_keyboard_line_free(input_keyboard_line_t *state)
|
|||||||
free(state->buffer);
|
free(state->buffer);
|
||||||
free(state);
|
free(state);
|
||||||
|
|
||||||
rarch_main_command(RARCH_CMD_OVERLAY_DEINIT);
|
input_keyboard_line_toggle_osk(false);
|
||||||
driver.osk_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,8 +83,7 @@ input_keyboard_line_t *input_keyboard_line_new(void *userdata,
|
|||||||
state->cb = cb;
|
state->cb = cb;
|
||||||
state->userdata = userdata;
|
state->userdata = userdata;
|
||||||
|
|
||||||
driver.osk_active = true;
|
input_keyboard_line_toggle_osk(true);
|
||||||
rarch_main_command(RARCH_CMD_OVERLAY_INIT);
|
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
@ -224,7 +229,7 @@ void input_keyboard_wait_keys_cancel(void)
|
|||||||
* This interfaces with the global driver struct and libretro callbacks.
|
* This interfaces with the global driver struct and libretro callbacks.
|
||||||
**/
|
**/
|
||||||
void input_keyboard_event(bool down, unsigned code,
|
void input_keyboard_event(bool down, unsigned code,
|
||||||
uint32_t character, uint16_t mod, bool enable_osk)
|
uint32_t character, uint16_t mod)
|
||||||
{
|
{
|
||||||
static bool deferred_wait_keys;
|
static bool deferred_wait_keys;
|
||||||
|
|
||||||
|
@ -92,13 +92,12 @@ void input_keyboard_line_free(input_keyboard_line_t *state);
|
|||||||
* @code : Keycode.
|
* @code : Keycode.
|
||||||
* @character : Character inputted.
|
* @character : Character inputted.
|
||||||
* @mod : TODO/FIXME: ???
|
* @mod : TODO/FIXME: ???
|
||||||
* @enable_osk : Fire off keyboard event from OSK
|
|
||||||
*
|
*
|
||||||
* Keyboard event utils. Called by drivers when keyboard events are fired.
|
* Keyboard event utils. Called by drivers when keyboard events are fired.
|
||||||
* This interfaces with the global driver struct and libretro callbacks.
|
* This interfaces with the global driver struct and libretro callbacks.
|
||||||
**/
|
**/
|
||||||
void input_keyboard_event(bool down, unsigned code, uint32_t character,
|
void input_keyboard_event(bool down, unsigned code, uint32_t character,
|
||||||
uint16_t mod, bool enable_osk);
|
uint16_t mod);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_keyboard_start_line:
|
* input_keyboard_start_line:
|
||||||
|
@ -537,7 +537,7 @@ static inline void input_poll_overlay(input_overlay_t *overlay_device, float opa
|
|||||||
for (j = 0; j < 32; j++)
|
for (j = 0; j < 32; j++)
|
||||||
if ((orig_bits & (1 << j)) != (new_bits & (1 << j)))
|
if ((orig_bits & (1 << j)) != (new_bits & (1 << j)))
|
||||||
input_keyboard_event(new_bits & (1 << j),
|
input_keyboard_event(new_bits & (1 << j),
|
||||||
i * 32 + j, 0, key_mod, true);
|
i * 32 + j, 0, key_mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,16 +152,6 @@ void menu_input_key_event(bool down, unsigned keycode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_input_osk_key_event(bool down, unsigned keycode,
|
|
||||||
uint32_t character, uint16_t mod)
|
|
||||||
{
|
|
||||||
if (!driver.menu)
|
|
||||||
return;
|
|
||||||
|
|
||||||
RARCH_LOG("down: %d, keycode: %d, character: %d, mod: %d.\n",
|
|
||||||
down, keycode, character, mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
void menu_input_poll_bind_state(struct menu_bind_state *state)
|
void menu_input_poll_bind_state(struct menu_bind_state *state)
|
||||||
{
|
{
|
||||||
unsigned i, b, a, h;
|
unsigned i, b, a, h;
|
||||||
|
@ -46,9 +46,6 @@ typedef enum
|
|||||||
void menu_input_key_event(bool down, unsigned keycode, uint32_t character,
|
void menu_input_key_event(bool down, unsigned keycode, uint32_t character,
|
||||||
uint16_t key_modifiers);
|
uint16_t key_modifiers);
|
||||||
|
|
||||||
void menu_input_osk_key_event(bool down, unsigned keycode,
|
|
||||||
uint32_t character, uint16_t mod);
|
|
||||||
|
|
||||||
void menu_input_key_start_line(void *data, const char *label,
|
void menu_input_key_start_line(void *data, const char *label,
|
||||||
const char *label_setting, unsigned type, unsigned idx,
|
const char *label_setting, unsigned type, unsigned idx,
|
||||||
input_keyboard_line_complete_t cb);
|
input_keyboard_line_complete_t cb);
|
||||||
|
@ -2689,8 +2689,7 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
|
|
||||||
driver.overlay = input_overlay_new(driver.osk_active ? g_settings.osk.overlay : g_settings.input.overlay,
|
driver.overlay = input_overlay_new(driver.osk_active ? g_settings.osk.overlay : g_settings.input.overlay,
|
||||||
driver.osk_active ? g_settings.osk.enable : g_settings.input.overlay_enable,
|
driver.osk_active ? g_settings.osk.enable : g_settings.input.overlay_enable,
|
||||||
driver.osk_active ? g_settings.osk.opacity : g_settings.input.overlay_opacity,
|
g_settings.input.overlay_opacity, g_settings.input.overlay_scale);
|
||||||
driver.osk_active ? g_settings.osk.scale : g_settings.input.overlay_scale);
|
|
||||||
if (!driver.overlay)
|
if (!driver.overlay)
|
||||||
RARCH_ERR("Failed to load overlay.\n");
|
RARCH_ERR("Failed to load overlay.\n");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user