Don't call meta key pressed if not bound

This commit is contained in:
twinaphex 2017-12-18 05:49:17 +01:00
parent 1978689dcb
commit 7b210ccf37
16 changed files with 22 additions and 97 deletions

View File

@ -1429,11 +1429,6 @@ static int16_t android_input_state(void *data,
return 0;
}
static bool android_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void android_input_free_input(void *data)
{
android_input_t *android = (android_input_t*)data;
@ -1587,7 +1582,7 @@ input_driver_t input_android = {
android_input_init,
android_input_poll,
android_input_state,
android_input_meta_key_pressed,
NULL, /* meta_key_pressed */
android_input_free_input,
android_input_set_sensor_state,
android_input_get_sensor_input,

View File

@ -328,11 +328,6 @@ static int16_t cocoa_input_state(void *data,
return 0;
}
static bool cocoa_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void cocoa_input_free(void *data)
{
unsigned i;
@ -426,7 +421,7 @@ input_driver_t input_cocoa = {
cocoa_input_init,
cocoa_input_poll,
cocoa_input_state,
cocoa_input_meta_key_pressed,
NULL, /* meta_key_pressed */
cocoa_input_free,
NULL,
NULL,

View File

@ -364,11 +364,6 @@ static int16_t dinput_pressed_analog(struct dinput_input *di,
return pressed_plus + pressed_minus;
}
static bool dinput_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t dinput_lightgun_aiming_state( struct dinput_input *di, unsigned idx, unsigned id )
{
const int edge_detect = 32700;
@ -925,7 +920,7 @@ input_driver_t input_dinput = {
dinput_init,
dinput_poll,
dinput_input_state,
dinput_meta_key_pressed,
NULL, /* meta_key_pressed */
dinput_free,
NULL,
NULL,

View File

@ -86,11 +86,6 @@ static void* dos_input_init(const char *joypad_driver)
return dos;
}
static bool dos_input_meta_key_pressed(void *data, int key)
{
return false;
}
static uint64_t dos_input_get_capabilities(void *data)
{
uint64_t caps = 0;
@ -129,7 +124,7 @@ input_driver_t input_dos = {
dos_input_init,
dos_input_poll,
dos_input_state,
dos_input_meta_key_pressed,
NULL, /* meta_key_pressed */
dos_input_free_input,
NULL,
NULL,

View File

@ -93,11 +93,6 @@ static int16_t linuxraw_analog_pressed(linuxraw_input_t *linuxraw,
return pressed_plus + pressed_minus;
}
static bool linuxraw_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t linuxraw_input_state(void *data,
rarch_joypad_info_t joypad_info,
const struct retro_keybind **binds, unsigned port,
@ -223,7 +218,7 @@ input_driver_t input_linuxraw = {
linuxraw_input_init,
linuxraw_input_poll,
linuxraw_input_state,
linuxraw_input_meta_key_pressed,
NULL, /* meta_key_pressed */
linuxraw_input_free,
NULL,
NULL,

View File

@ -179,11 +179,6 @@ static void* ps3_input_init(const char *joypad_driver)
return ps3;
}
static bool ps3_input_meta_key_pressed(void *data, int key)
{
return false;
}
static uint64_t ps3_input_get_capabilities(void *data)
{
(void)data;
@ -266,7 +261,7 @@ input_driver_t input_ps3 = {
ps3_input_init,
ps3_input_poll,
ps3_input_state,
ps3_input_meta_key_pressed,
NULL, /* meta_key_pressed */
ps3_input_free_input,
ps3_input_set_sensor_state,
NULL,

View File

@ -803,11 +803,6 @@ static int16_t qnx_input_state(void *data,
return 0;
}
static bool qnx_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void qnx_input_free_input(void *data)
{
if (data)
@ -853,7 +848,7 @@ input_driver_t input_qnx = {
qnx_input_init,
qnx_input_poll,
qnx_input_state,
qnx_input_meta_key_pressed,
NULL, /* meta_key_pressed */
qnx_input_free_input,
NULL,
NULL,

View File

@ -81,13 +81,6 @@ static bool rwebinput_key_pressed_internal(void *data, int key)
return ret;
}
static bool rwebinput_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
return false;
}
static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
const struct retro_keybind *binds, unsigned id)
{
@ -254,7 +247,7 @@ input_driver_t input_rwebinput = {
rwebinput_input_init,
rwebinput_input_poll,
rwebinput_input_state,
rwebinput_meta_key_pressed,
NULL, /* meta_key_pressed */
rwebinput_input_free,
NULL,
NULL,

View File

@ -89,11 +89,6 @@ static int16_t sdl_analog_pressed(sdl_input_t *sdl, const struct retro_keybind *
return pressed_plus + pressed_minus;
}
static bool sdl_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t sdl_joypad_device_state(sdl_input_t *sdl,
rarch_joypad_info_t joypad_info,
const struct retro_keybind *binds,
@ -409,7 +404,7 @@ input_driver_t input_sdl = {
sdl_input_init,
sdl_input_poll,
sdl_input_state,
sdl_input_meta_key_pressed,
NULL, /* meta_key_pressed */
sdl_input_free,
NULL,
NULL,

View File

@ -907,11 +907,6 @@ static int16_t udev_input_state(void *data,
return 0;
}
static bool udev_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void udev_input_free(void *data)
{
unsigned i;
@ -1160,7 +1155,7 @@ input_driver_t input_udev = {
udev_input_init,
udev_input_poll,
udev_input_state,
udev_input_meta_key_pressed,
NULL, /* meta_key_pressed */
udev_input_free,
NULL,
NULL,

View File

@ -320,19 +320,11 @@ static void input_wl_keyboard_mapping_set_block(void *data, bool value)
wl->blocked = value;
}
static bool input_wl_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
/* FIXME: What is this supposed to do? */
return false;
}
input_driver_t input_wayland = {
NULL,
input_wl_poll,
input_wl_state,
input_wl_meta_key_pressed,
NULL, /* meta_key_pressed */
input_wl_free,
NULL,
NULL,

View File

@ -202,10 +202,7 @@ static void* wiiu_input_init(const char *joypad_driver)
static bool wiiu_input_meta_key_pressed(void *data, int key)
{
if (BIT64_GET(lifecycle_state, key))
return true;
return false;
return BIT64_GET(lifecycle_state, key);
}
static uint64_t wiiu_input_get_capabilities(void *data)

View File

@ -762,11 +762,6 @@ static int16_t winraw_input_state(void *d,
return 0;
}
static bool winraw_meta_key_pressed(void *u1, int u2)
{
return false;
}
static void winraw_free(void *d)
{
winraw_input_t *wr = (winraw_input_t*)d;
@ -841,7 +836,7 @@ input_driver_t input_winraw = {
winraw_init,
winraw_poll,
winraw_input_state,
winraw_meta_key_pressed,
NULL, /* meta_key_pressed */
winraw_free,
NULL,
NULL,

View File

@ -179,11 +179,6 @@ static int16_t x_pressed_analog(x11_input_t *x11,
return pressed_plus + pressed_minus;
}
static bool x_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t x_lightgun_aiming_state( x11_input_t *x11, unsigned idx, unsigned id )
{
const int edge_detect = 32700;
@ -531,7 +526,7 @@ input_driver_t input_x = {
x_input_init,
x_input_poll,
x_input_state,
x_input_meta_key_pressed,
NULL, /* meta_key_pressed */
x_input_free,
NULL,
NULL,

View File

@ -94,11 +94,6 @@ static void *xdk_input_init(const char *joypad_driver)
return xdk;
}
static bool xdk_input_meta_key_pressed(void *data, int key)
{
return false;
}
static uint64_t xdk_input_get_capabilities(void *data)
{
(void)data;
@ -178,7 +173,7 @@ input_driver_t input_xinput = {
xdk_input_init,
xdk_input_poll,
xdk_input_state,
xdk_input_meta_key_pressed,
NULL, /* meta_key_pressed */
xdk_input_free_input,
NULL,
NULL,

View File

@ -787,10 +787,13 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2)
static INLINE bool input_keys_pressed_iterate(unsigned i,
retro_bits_t* p_new_state)
{
if ((i >= RARCH_FIRST_META_KEY) &&
current_input->meta_key_pressed(current_input_data, i)
)
return true;
if (current_input->meta_key_pressed)
{
if ((i >= RARCH_FIRST_META_KEY) &&
current_input->meta_key_pressed(current_input_data, i)
)
return true;
}
#ifdef HAVE_OVERLAY
if (overlay_ptr &&