mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Put keyboard_mapping_blocked into p_rarch / rarch struct
instead
This commit is contained in:
parent
035efa5136
commit
d4d8b6934a
@ -1393,8 +1393,12 @@ static int16_t android_input_state(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds, unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
const struct retro_keybind **binds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
android_input_t *android = (android_input_t*)data;
|
||||
|
||||
@ -1620,6 +1624,5 @@ input_driver_t input_android = {
|
||||
|
||||
android_input_grab_mouse,
|
||||
NULL,
|
||||
android_input_set_rumble,
|
||||
false
|
||||
android_input_set_rumble
|
||||
};
|
||||
|
@ -187,8 +187,12 @@ static int16_t cocoa_input_state(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds, unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
const struct retro_keybind **binds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
|
||||
|
||||
@ -208,7 +212,7 @@ static int16_t cocoa_input_state(
|
||||
#endif
|
||||
;
|
||||
|
||||
if (!input_cocoa.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
|
@ -41,8 +41,11 @@ static int16_t ctr_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
ctr_input_t *ctr = (ctr_input_t*)data;
|
||||
|
||||
@ -87,8 +90,6 @@ static void* ctr_input_init(const char *joypad_driver)
|
||||
|
||||
static uint64_t ctr_input_get_capabilities(void *data)
|
||||
{
|
||||
(void)data;
|
||||
|
||||
return (1 << RETRO_DEVICE_JOYPAD) | (1 << RETRO_DEVICE_ANALOG);
|
||||
}
|
||||
|
||||
@ -103,6 +104,5 @@ input_driver_t input_ctr = {
|
||||
"ctr",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -533,8 +533,12 @@ static int16_t dinput_input_state(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds, unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
const struct retro_keybind **binds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
settings_t *settings;
|
||||
struct dinput_input *di = (struct dinput_input*)data;
|
||||
@ -568,7 +572,7 @@ static int16_t dinput_input_state(
|
||||
}
|
||||
}
|
||||
|
||||
if (!input_dinput.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -597,7 +601,7 @@ static int16_t dinput_input_state(
|
||||
&& (di->state[rarch_keysym_lut
|
||||
[(enum retro_key)binds[port][id].key]] & 0x80)
|
||||
&& ( (id == RARCH_GAME_FOCUS_TOGGLE)
|
||||
|| !input_dinput.keyboard_mapping_blocked)
|
||||
|| !keyboard_mapping_blocked)
|
||||
)
|
||||
return 1;
|
||||
else if (
|
||||
@ -738,7 +742,7 @@ static int16_t dinput_input_state(
|
||||
return 1;
|
||||
else if (
|
||||
binds[port][new_id].key < RETROK_LAST
|
||||
&& !input_dinput.keyboard_mapping_blocked
|
||||
&& !keyboard_mapping_blocked
|
||||
&& di->state[rarch_keysym_lut
|
||||
[(enum retro_key)binds[port][new_id].key]] & 0x80
|
||||
)
|
||||
@ -1024,6 +1028,5 @@ input_driver_t input_dinput = {
|
||||
"dinput",
|
||||
dinput_grab_mouse,
|
||||
NULL,
|
||||
dinput_set_rumble,
|
||||
false
|
||||
dinput_set_rumble
|
||||
};
|
||||
|
@ -68,8 +68,11 @@ static int16_t dos_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
dos_input_t *dos = (dos_input_t*)data;
|
||||
|
||||
@ -158,6 +161,5 @@ input_driver_t input_dos = {
|
||||
"dos",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -144,8 +144,11 @@ static int16_t gx_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
gx_input_t *gx = (gx_input_t*)data;
|
||||
|
||||
@ -304,6 +307,5 @@ input_driver_t input_gx = {
|
||||
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -77,8 +77,12 @@ static int16_t linuxraw_input_state(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds, unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
const struct retro_keybind **binds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
linuxraw_input_t *linuxraw = (linuxraw_input_t*)data;
|
||||
|
||||
@ -230,6 +234,5 @@ input_driver_t input_linuxraw = {
|
||||
"linuxraw",
|
||||
NULL, /* grab_mouse */
|
||||
linux_terminal_grab_stdin,
|
||||
linuxraw_set_rumble,
|
||||
false
|
||||
linuxraw_set_rumble
|
||||
};
|
||||
|
@ -37,8 +37,11 @@ static int16_t ps2_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
ps2_input_t *ps2 = (ps2_input_t*)data;
|
||||
|
||||
@ -107,6 +110,5 @@ input_driver_t input_ps2 = {
|
||||
"ps2",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
ps2_input_set_rumble,
|
||||
false
|
||||
ps2_input_set_rumble
|
||||
};
|
||||
|
@ -97,8 +97,11 @@ static int16_t ps3_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)data;
|
||||
|
||||
@ -236,6 +239,5 @@ input_driver_t input_ps3 = {
|
||||
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
ps3_input_set_rumble,
|
||||
false
|
||||
ps3_input_set_rumble
|
||||
};
|
||||
|
@ -43,8 +43,11 @@ static int16_t ps4_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
ps4_input_t *ps4 = (ps4_input_t*)data;
|
||||
|
||||
@ -110,6 +113,5 @@ input_driver_t input_ps4 = {
|
||||
"ps4",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
ps4_input_set_rumble,
|
||||
false
|
||||
ps4_input_set_rumble
|
||||
};
|
||||
|
@ -213,8 +213,11 @@ static int16_t ps3_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
ps3_input_t *ps3 = (ps3_input_t*)data;
|
||||
|
||||
@ -296,7 +299,6 @@ static void* ps3_input_init(const char *joypad_driver)
|
||||
|
||||
static uint64_t ps3_input_get_capabilities(void *data)
|
||||
{
|
||||
(void)data;
|
||||
return
|
||||
#ifdef HAVE_MOUSE
|
||||
(1 << RETRO_DEVICE_MOUSE) |
|
||||
@ -307,10 +309,7 @@ static uint64_t ps3_input_get_capabilities(void *data)
|
||||
}
|
||||
|
||||
static bool ps3_input_set_sensor_state(void *data, unsigned port,
|
||||
enum retro_sensor_action action, unsigned event_rate)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
enum retro_sensor_action action, unsigned event_rate) { return false; }
|
||||
|
||||
input_driver_t input_ps3 = {
|
||||
ps3_input_init,
|
||||
@ -324,8 +323,7 @@ input_driver_t input_ps3 = {
|
||||
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
||||
/* RetroArch - A frontend for libretro.
|
||||
@ -542,14 +540,9 @@ static bool ps3_joypad_query_pad(unsigned pad)
|
||||
}
|
||||
|
||||
static bool ps3_joypad_rumble(unsigned pad,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
enum retro_rumble_effect effect, uint16_t strength) { return true; }
|
||||
|
||||
static void ps3_joypad_destroy(void)
|
||||
{
|
||||
}
|
||||
static void ps3_joypad_destroy(void) { }
|
||||
|
||||
input_device_driver_t ps3_joypad = {
|
||||
ps3_joypad_init,
|
||||
|
@ -277,8 +277,11 @@ static int16_t psp_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
psp_input_t *psp = (psp_input_t*)data;
|
||||
|
||||
@ -474,6 +477,5 @@ input_driver_t input_psp = {
|
||||
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
psp_input_set_rumble,
|
||||
false
|
||||
psp_input_set_rumble
|
||||
};
|
||||
|
@ -775,7 +775,11 @@ static int16_t qnx_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
qnx_input_t *qnx = (qnx_input_t*)data;
|
||||
|
||||
@ -788,7 +792,7 @@ static int16_t qnx_input_state(
|
||||
int16_t ret = joypad->state(
|
||||
joypad_info, binds[port], port);
|
||||
|
||||
if (!input_qnx.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -813,7 +817,7 @@ static int16_t qnx_input_state(
|
||||
return 1;
|
||||
else if (
|
||||
((id == RARCH_GAME_FOCUS_TOGGLE) ||
|
||||
!input_qnx.keyboard_mapping_blocked) &&
|
||||
!keyboard_mapping_blocked) &&
|
||||
qnx_keyboard_pressed(qnx, key)
|
||||
)
|
||||
return 1;
|
||||
@ -865,6 +869,5 @@ input_driver_t input_qnx = {
|
||||
"qnx_input",
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
false
|
||||
NULL
|
||||
};
|
||||
|
@ -467,7 +467,8 @@ static int16_t rwebinput_is_pressed(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind *binds,
|
||||
unsigned port, unsigned id)
|
||||
unsigned port, unsigned id,
|
||||
bool keyboard_mapping_blocked)
|
||||
{
|
||||
const struct retro_keybind *bind = &binds[id];
|
||||
/* Auto-binds are per joypad, not per user. */
|
||||
@ -478,7 +479,7 @@ static int16_t rwebinput_is_pressed(
|
||||
int key = bind->key;
|
||||
|
||||
if ((key < RETROK_LAST) && rwebinput_key_pressed(rwebinput, key))
|
||||
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !input_rwebinput.keyboard_mapping_blocked)
|
||||
if ((id == RARCH_GAME_FOCUS_TOGGLE) || !keyboard_mapping_blocked)
|
||||
return 1;
|
||||
if (port == 0 && !!rwebinput_mouse_state(&rwebinput->mouse,
|
||||
bind->mbutton, false))
|
||||
@ -497,7 +498,11 @@ static int16_t rwebinput_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
|
||||
|
||||
@ -514,7 +519,8 @@ static int16_t rwebinput_input_state(
|
||||
{
|
||||
if (rwebinput_is_pressed(
|
||||
rwebinput, joypad,
|
||||
joypad_info, binds[port], port, i))
|
||||
joypad_info, binds[port], port, i,
|
||||
keyboard_mapping_blocked))
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
@ -529,7 +535,8 @@ static int16_t rwebinput_input_state(
|
||||
{
|
||||
if (rwebinput_is_pressed(rwebinput, joypad,
|
||||
joypad_info, binds[port],
|
||||
port, id))
|
||||
port, id,
|
||||
keyboard_mapping_blocked))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -556,13 +563,15 @@ static int16_t rwebinput_input_state(
|
||||
if (id_plus_valid && id_plus_key < RETROK_LAST)
|
||||
{
|
||||
if (rwebinput_is_pressed(rwebinput,
|
||||
joypad, joypad_info, binds[port], idx, id_plus))
|
||||
joypad, joypad_info, binds[port], idx, id_plus,
|
||||
keyboard_mapping_blocked))
|
||||
ret = 0x7fff;
|
||||
}
|
||||
if (id_minus_valid && id_minus_key < RETROK_LAST)
|
||||
{
|
||||
if (rwebinput_is_pressed(rwebinput,
|
||||
joypad, joypad_info, binds[port], idx, id_minus))
|
||||
joypad, joypad_info, binds[port], idx, id_minus,
|
||||
keyboard_mapping_blocked))
|
||||
ret += -0x7fff;
|
||||
}
|
||||
|
||||
@ -694,6 +703,5 @@ input_driver_t input_rwebinput = {
|
||||
"rwebinput",
|
||||
rwebinput_grab_mouse,
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -184,7 +184,11 @@ static int16_t sdl_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
sdl_input_t *sdl = (sdl_input_t*)data;
|
||||
|
||||
@ -427,6 +431,5 @@ input_driver_t input_sdl = {
|
||||
NULL, /* grab_mouse */
|
||||
#endif
|
||||
NULL,
|
||||
sdl_set_rumble,
|
||||
false
|
||||
sdl_set_rumble
|
||||
};
|
||||
|
@ -370,11 +370,15 @@ static int16_t switch_input_mouse_state(
|
||||
}
|
||||
#endif
|
||||
|
||||
static int16_t switch_input_state(void *data,
|
||||
static int16_t switch_input_state(
|
||||
void *data,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
switch_input_t *sw = (switch_input_t*) data;
|
||||
|
||||
@ -982,6 +986,5 @@ input_driver_t input_switch = {
|
||||
"switch",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
switch_input_set_rumble,
|
||||
false
|
||||
switch_input_set_rumble
|
||||
};
|
||||
|
@ -958,9 +958,13 @@ static int16_t udev_input_lightgun_state(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
if (!input_udev.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][id].key < RETROK_LAST)
|
||||
&& udev_keyboard_pressed(udev, binds[port]
|
||||
[id].key) )
|
||||
@ -985,7 +989,11 @@ static int16_t udev_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
udev_input_t *udev = (udev_input_t*)data;
|
||||
|
||||
@ -1006,7 +1014,7 @@ static int16_t udev_input_state(
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
if (!input_udev.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -1034,7 +1042,7 @@ static int16_t udev_input_state(
|
||||
(binds[port][id].key < RETROK_LAST) &&
|
||||
udev_keyboard_pressed(udev, binds[port][id].key)
|
||||
&& (( id == RARCH_GAME_FOCUS_TOGGLE)
|
||||
|| !input_udev.keyboard_mapping_blocked)
|
||||
|| !keyboard_mapping_blocked)
|
||||
)
|
||||
return 1;
|
||||
else if (udev_mouse_button_pressed(udev, port,
|
||||
@ -1108,47 +1116,69 @@ static int16_t udev_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_TRIGGER);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_TRIGGER);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_RELOAD);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_RELOAD);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_A);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_A);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_B);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_B);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_C);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_C);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_START);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_START);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_SELECT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_SELECT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_UP);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_UP);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
return udev_input_lightgun_state(udev, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
/*deprecated*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_X:
|
||||
{
|
||||
@ -1408,6 +1438,5 @@ input_driver_t input_udev = {
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
udev_input_set_rumble,
|
||||
false
|
||||
udev_input_set_rumble
|
||||
};
|
||||
|
@ -90,8 +90,11 @@ static int16_t uwp_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned index, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned index,
|
||||
unsigned id)
|
||||
{
|
||||
uwp_input_t *uwp = (uwp_input_t*)data;
|
||||
|
||||
@ -104,7 +107,7 @@ static int16_t uwp_input_state(
|
||||
int16_t ret = joypad->state(
|
||||
joypad_info, binds[port], port);
|
||||
|
||||
if (!input_uwp.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -143,7 +146,7 @@ static int16_t uwp_input_state(
|
||||
else if ((binds[port][id].key < RETROK_LAST)
|
||||
&& uwp_keyboard_pressed(binds[port][id].key)
|
||||
&& ((id == RARCH_GAME_FOCUS_TOGGLE) ||
|
||||
!input_uwp.keyboard_mapping_blocked)
|
||||
!keyboard_mapping_blocked)
|
||||
)
|
||||
return 1;
|
||||
else if (uwp_mouse_state(port,
|
||||
@ -211,6 +214,5 @@ input_driver_t input_uwp = {
|
||||
"uwp",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
uwp_input_set_rumble,
|
||||
false
|
||||
uwp_input_set_rumble
|
||||
};
|
||||
|
@ -271,7 +271,11 @@ static int16_t input_wl_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
input_ctx_wayland_data_t *wl = (input_ctx_wayland_data_t*)data;
|
||||
|
||||
@ -431,6 +435,5 @@ input_driver_t input_wayland = {
|
||||
"wayland",
|
||||
input_wl_grab_mouse,
|
||||
NULL,
|
||||
input_wl_set_rumble,
|
||||
false
|
||||
input_wl_set_rumble
|
||||
};
|
||||
|
@ -122,8 +122,11 @@ static int16_t wiiu_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
wiiu_input_t *wiiu = (wiiu_input_t*)data;
|
||||
|
||||
@ -198,6 +201,5 @@ input_driver_t input_wiiu = {
|
||||
"wiiu",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -563,9 +563,13 @@ static int16_t winraw_input_lightgun_state(
|
||||
const input_device_driver_t *joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][id].key < RETROK_LAST)
|
||||
&& winraw_keyboard_pressed(wr, binds[port]
|
||||
[id].key))
|
||||
@ -589,7 +593,11 @@ static int16_t winraw_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
settings_t *settings = NULL;
|
||||
winraw_mouse_t *mouse = NULL;
|
||||
@ -639,7 +647,7 @@ static int16_t winraw_input_state(
|
||||
}
|
||||
}
|
||||
|
||||
if (!input_winraw.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -668,7 +676,7 @@ static int16_t winraw_input_state(
|
||||
(binds[port][id].key < RETROK_LAST)
|
||||
&& winraw_keyboard_pressed(wr, binds[port][id].key)
|
||||
&& (( id == RARCH_GAME_FOCUS_TOGGLE)
|
||||
|| !input_winraw.keyboard_mapping_blocked)
|
||||
|| !keyboard_mapping_blocked)
|
||||
)
|
||||
return 1;
|
||||
else if (mouse && winraw_mouse_button_pressed(wr,
|
||||
@ -704,47 +712,69 @@ static int16_t winraw_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_TRIGGER);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_TRIGGER);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_RELOAD);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_RELOAD);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_A);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_A);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_B);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_B);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_AUX_C);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_AUX_C);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_START);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_START);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_SELECT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_SELECT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_UP);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_UP);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_DOWN);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_LEFT);
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_DPAD_RIGHT);
|
||||
/*deprecated*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_X:
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_Y:
|
||||
@ -754,7 +784,9 @@ static int16_t winraw_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_PAUSE:
|
||||
return winraw_input_lightgun_state(wr, mouse, joypad,
|
||||
joypad_info,
|
||||
binds, port, device, idx, RARCH_LIGHTGUN_START);
|
||||
binds,
|
||||
keyboard_mapping_blocked,
|
||||
port, device, idx, RARCH_LIGHTGUN_START);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -823,6 +855,5 @@ input_driver_t input_winraw = {
|
||||
"raw",
|
||||
winraw_grab_mouse,
|
||||
NULL,
|
||||
winraw_set_rumble,
|
||||
false
|
||||
winraw_set_rumble
|
||||
};
|
||||
|
@ -238,8 +238,12 @@ static int16_t x_input_state(
|
||||
const input_device_driver_t *joypad,
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds, unsigned port,
|
||||
unsigned device, unsigned idx, unsigned id)
|
||||
const struct retro_keybind **binds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
x11_input_t *x11 = (x11_input_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -268,7 +272,7 @@ static int16_t x_input_state(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
{
|
||||
for (i = 0; i < RARCH_FIRST_CUSTOM_BIND; i++)
|
||||
{
|
||||
@ -296,7 +300,7 @@ static int16_t x_input_state(
|
||||
((binds[port][id].key < RETROK_LAST) &&
|
||||
x_keyboard_pressed(x11, binds[port][id].key))
|
||||
&& (( id == RARCH_GAME_FOCUS_TOGGLE)
|
||||
|| !input_x.keyboard_mapping_blocked)
|
||||
|| !keyboard_mapping_blocked)
|
||||
)
|
||||
return 1;
|
||||
else if (settings->uints.input_mouse_index[port] == 0)
|
||||
@ -371,7 +375,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_TRIGGER;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -394,7 +398,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_RELOAD;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -417,7 +421,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_AUX_A;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -440,7 +444,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_AUX_B;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -463,7 +467,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_AUX_C;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -486,7 +490,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_START:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_START;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -509,7 +513,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SELECT:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_SELECT;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -532,7 +536,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_UP:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_DPAD_UP;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -555,7 +559,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_DOWN:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_DPAD_DOWN;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -578,7 +582,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_LEFT:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_DPAD_LEFT;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -601,7 +605,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_DPAD_RIGHT:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_DPAD_RIGHT;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -629,7 +633,7 @@ static int16_t x_input_state(
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_PAUSE:
|
||||
{
|
||||
unsigned new_id = RARCH_LIGHTGUN_START;
|
||||
if (!input_x.keyboard_mapping_blocked)
|
||||
if (!keyboard_mapping_blocked)
|
||||
if ((binds[port][new_id].key < RETROK_LAST)
|
||||
&& x_keyboard_pressed(x11, binds[port]
|
||||
[new_id].key) )
|
||||
@ -780,6 +784,5 @@ input_driver_t input_x = {
|
||||
"x",
|
||||
x_grab_mouse,
|
||||
NULL,
|
||||
x_set_rumble,
|
||||
false
|
||||
x_set_rumble
|
||||
};
|
||||
|
@ -46,8 +46,11 @@ static int16_t xdk_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
unsigned port, unsigned device,
|
||||
unsigned index, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned index,
|
||||
unsigned id)
|
||||
{
|
||||
xdk_input_t *xdk = (xdk_input_t*)data;
|
||||
|
||||
@ -123,6 +126,5 @@ input_driver_t input_xinput = {
|
||||
"xinput",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
xdk_input_set_rumble,
|
||||
false
|
||||
xdk_input_set_rumble
|
||||
};
|
||||
|
@ -67,8 +67,11 @@ static int16_t xenon360_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **binds,
|
||||
bool port, unsigned device,
|
||||
unsigned idx, unsigned id)
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port,
|
||||
unsigned device,
|
||||
unsigned idx,
|
||||
unsigned id)
|
||||
{
|
||||
uint64_t button = binds[port][id].joykey;
|
||||
|
||||
@ -137,6 +140,5 @@ input_driver_t input_xenon360 = {
|
||||
"xenon360",
|
||||
NULL, /* grab_mouse */
|
||||
NULL,
|
||||
NULL, /* set_rumble */
|
||||
false
|
||||
NULL /* set_rumble */
|
||||
};
|
||||
|
@ -185,6 +185,7 @@ struct input_driver
|
||||
const input_device_driver_t *sec_joypad_data,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **retro_keybinds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port, unsigned device, unsigned index, unsigned id);
|
||||
|
||||
/* Frees the input struct. */
|
||||
@ -203,7 +204,6 @@ struct input_driver
|
||||
const input_device_driver_t *sec_joypad_data,
|
||||
unsigned port,
|
||||
enum retro_rumble_effect effect, uint16_t state);
|
||||
bool keyboard_mapping_blocked;
|
||||
};
|
||||
|
||||
struct rarch_joypad_driver
|
||||
|
91
retroarch.c
91
retroarch.c
@ -682,6 +682,7 @@ static int16_t input_null_input_state(
|
||||
const input_device_driver_t *sec_joypad,
|
||||
rarch_joypad_info_t *joypad_info,
|
||||
const struct retro_keybind **retro_keybinds,
|
||||
bool keyboard_mapping_blocked,
|
||||
unsigned port, unsigned device, unsigned index, unsigned id) { return 0; }
|
||||
static void input_null_free(void *data) { }
|
||||
static bool input_null_set_sensor_state(void *data, unsigned port,
|
||||
@ -707,8 +708,7 @@ static input_driver_t input_null = {
|
||||
"null",
|
||||
input_null_grab_mouse,
|
||||
input_null_grab_stdin,
|
||||
input_null_set_rumble,
|
||||
false,
|
||||
input_null_set_rumble
|
||||
};
|
||||
|
||||
static input_driver_t *input_drivers[] = {
|
||||
@ -2553,6 +2553,7 @@ struct rarch_state
|
||||
bool midi_drv_output_pending;
|
||||
|
||||
bool main_ui_companion_is_on_foreground;
|
||||
bool keyboard_mapping_blocked;
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
bool shader_presets_need_reload;
|
||||
@ -3644,6 +3645,7 @@ static void menu_input_key_bind_poll_bind_state(
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
NULL,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, RETRO_DEVICE_KEYBOARD, 0, RETROK_RETURN);
|
||||
|
||||
menu_input_key_bind_poll_bind_state_internal(
|
||||
@ -3984,8 +3986,7 @@ static bool menu_input_key_bind_iterate(
|
||||
|
||||
if (RARCH_TIMER_HAS_EXPIRED(_binds->timer_timeout))
|
||||
{
|
||||
if (input_drv)
|
||||
input_drv->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
|
||||
/*skip to next bind*/
|
||||
_binds->begin++;
|
||||
@ -4015,11 +4016,10 @@ static bool menu_input_key_bind_iterate(
|
||||
}
|
||||
|
||||
{
|
||||
bool complete = false;
|
||||
struct menu_bind_state new_binds = *_binds;
|
||||
bool complete = false;
|
||||
struct menu_bind_state new_binds = *_binds;
|
||||
|
||||
if (input_drv)
|
||||
input_drv->keyboard_mapping_blocked = true;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
|
||||
menu_input_key_bind_poll_bind_state(p_rarch,
|
||||
&new_binds, timed_out);
|
||||
@ -4064,8 +4064,7 @@ static bool menu_input_key_bind_iterate(
|
||||
/* Update bind */
|
||||
*(new_binds.output) = new_binds.buffer;
|
||||
|
||||
if (input_drv)
|
||||
input_drv->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
|
||||
/* Avoid new binds triggering things right away. */
|
||||
/* Inhibits input for 2 frames
|
||||
@ -17157,7 +17156,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
input_driver_grab_mouse(p_rarch);
|
||||
video_driver_hide_mouse();
|
||||
p_rarch->input_driver_block_hotkey = true;
|
||||
p_rarch->current_input->keyboard_mapping_blocked = true;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
if (mode != -1)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_ON),
|
||||
1, 120, true,
|
||||
@ -17169,7 +17168,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
if (!video_fullscreen)
|
||||
video_driver_show_mouse();
|
||||
p_rarch->input_driver_block_hotkey = false;
|
||||
p_rarch->current_input->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
if (mode != -1)
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_GAME_FOCUS_OFF),
|
||||
1, 120, true,
|
||||
@ -23422,6 +23421,7 @@ static void input_poll_overlay(
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
NULL,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, device, i, RETRO_DEVICE_ID_POINTER_PRESSED);
|
||||
i++)
|
||||
{
|
||||
@ -23432,6 +23432,7 @@ static void input_poll_overlay(
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
NULL,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, device, i, RETRO_DEVICE_ID_POINTER_X);
|
||||
int16_t y = input_ptr->input_state(
|
||||
input_data,
|
||||
@ -23439,6 +23440,7 @@ static void input_poll_overlay(
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
NULL,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, device, i, RETRO_DEVICE_ID_POINTER_Y);
|
||||
|
||||
memset(&polled_data, 0, sizeof(struct input_overlay_state));
|
||||
@ -23883,6 +23885,7 @@ static void input_driver_poll(void)
|
||||
sec_joypad,
|
||||
&joypad_info[i],
|
||||
p_rarch->libretro_input_binds,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
(unsigned)i, RETRO_DEVICE_JOYPAD, 0, RARCH_TURBO_ENABLE);
|
||||
}
|
||||
|
||||
@ -23934,6 +23937,7 @@ static void input_driver_poll(void)
|
||||
sec_joypad,
|
||||
&joypad_info[i],
|
||||
p_rarch->libretro_input_binds,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
(unsigned)i, RETRO_DEVICE_JOYPAD,
|
||||
0, RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||
|
||||
@ -24629,7 +24633,9 @@ static int16_t input_state(unsigned port, unsigned device,
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
p_rarch->libretro_input_binds, port, device, idx, id);
|
||||
p_rarch->libretro_input_binds,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port, device, idx, id);
|
||||
|
||||
if ( (device == RETRO_DEVICE_ANALOG) &&
|
||||
(ret == 0))
|
||||
@ -24838,7 +24844,9 @@ static int16_t menu_input_read_mouse_hw(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
NULL, 0, device, 0, type);
|
||||
NULL,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, device, 0, type);
|
||||
}
|
||||
|
||||
static void menu_input_get_mouse_hw_state(
|
||||
@ -25035,7 +25043,10 @@ static void menu_input_get_touchscreen_hw_state(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info, binds,
|
||||
0, pointer_device, 0, RETRO_DEVICE_ID_POINTER_X);
|
||||
0,
|
||||
pointer_device,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, RETRO_DEVICE_ID_POINTER_X);
|
||||
hw_state->x = ((pointer_x + 0x7fff) * (int)fb_width) / 0xFFFF;
|
||||
|
||||
/* > An annoyance - we get different starting positions
|
||||
@ -25062,7 +25073,9 @@ static void menu_input_get_touchscreen_hw_state(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info, binds,
|
||||
0, pointer_device, 0, RETRO_DEVICE_ID_POINTER_Y);
|
||||
0, pointer_device,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, RETRO_DEVICE_ID_POINTER_Y);
|
||||
hw_state->y = ((pointer_y + 0x7fff) * (int)fb_height) / 0xFFFF;
|
||||
|
||||
if (pointer_device == RARCH_DEVICE_POINTER_SCREEN)
|
||||
@ -25085,7 +25098,9 @@ static void menu_input_get_touchscreen_hw_state(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info, binds,
|
||||
0, pointer_device, 0, RETRO_DEVICE_ID_POINTER_PRESSED);
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, pointer_device,
|
||||
0, RETRO_DEVICE_ID_POINTER_PRESSED);
|
||||
if (hw_state->select_pressed || (hw_state->select_pressed != last_select_pressed))
|
||||
hw_state->active = true;
|
||||
last_select_pressed = hw_state->select_pressed;
|
||||
@ -25097,7 +25112,9 @@ static void menu_input_get_touchscreen_hw_state(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info, binds,
|
||||
0, pointer_device, 0, RARCH_DEVICE_ID_POINTER_BACK);
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
0, pointer_device,
|
||||
0, RARCH_DEVICE_ID_POINTER_BACK);
|
||||
if (hw_state->cancel_pressed || (hw_state->cancel_pressed != last_cancel_pressed))
|
||||
hw_state->active = true;
|
||||
last_cancel_pressed = hw_state->cancel_pressed;
|
||||
@ -26354,7 +26371,9 @@ static void input_keys_pressed(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
joypad_info,
|
||||
&binds[port], port, RETRO_DEVICE_JOYPAD, 0,
|
||||
&binds[port],
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port, RETRO_DEVICE_JOYPAD, 0,
|
||||
RARCH_ENABLE_HOTKEY))
|
||||
{
|
||||
if (p_rarch->input_hotkey_block_counter < input_hotkey_block_delay)
|
||||
@ -26387,7 +26406,9 @@ static void input_keys_pressed(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
joypad_info,
|
||||
&binds[port], port,
|
||||
&binds[port],
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port,
|
||||
RETRO_DEVICE_JOYPAD, 0, RARCH_GAME_FOCUS_TOGGLE))
|
||||
p_rarch->input_driver_block_hotkey = false;
|
||||
}
|
||||
@ -26411,7 +26432,9 @@ static void input_keys_pressed(
|
||||
p_rarch->current_input_data,
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
joypad_info, &binds[port], port, RETRO_DEVICE_JOYPAD, 0,
|
||||
joypad_info, &binds[port],
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port, RETRO_DEVICE_JOYPAD, 0,
|
||||
RETRO_DEVICE_ID_JOYPAD_MASK);
|
||||
|
||||
for (i = 0; i < RARCH_FIRST_META_KEY; i++)
|
||||
@ -26449,7 +26472,9 @@ static void input_keys_pressed(
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
joypad_info,
|
||||
&binds[port], port, RETRO_DEVICE_JOYPAD, 0, i);
|
||||
&binds[port],
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port, RETRO_DEVICE_JOYPAD, 0, i);
|
||||
if ( bit_pressed
|
||||
|| BIT64_GET(lifecycle_state, i)
|
||||
|| input_keys_pressed_other_sources(p_rarch, i, p_new_state))
|
||||
@ -27077,6 +27102,7 @@ static bool input_mouse_button_raw(
|
||||
sec_joypad,
|
||||
&joypad_info,
|
||||
p_rarch->libretro_input_binds,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port,
|
||||
RETRO_DEVICE_MOUSE, 0, id);
|
||||
return false;
|
||||
@ -27337,7 +27363,7 @@ static const char **input_keyboard_start_line(void *userdata,
|
||||
p_rarch->keyboard_line->userdata = userdata;
|
||||
|
||||
/* While reading keyboard line input, we have to block all hotkeys. */
|
||||
p_rarch->current_input->keyboard_mapping_blocked = true;
|
||||
p_rarch->keyboard_mapping_blocked = true;
|
||||
|
||||
return (const char**)&p_rarch->keyboard_line->buffer;
|
||||
}
|
||||
@ -27457,7 +27483,7 @@ void input_keyboard_event(bool down, unsigned code,
|
||||
|
||||
p_rarch->keyboard_press_cb = NULL;
|
||||
p_rarch->keyboard_press_data = NULL;
|
||||
p_rarch->current_input->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
deferred_wait_keys = false;
|
||||
}
|
||||
else if (p_rarch->keyboard_press_cb)
|
||||
@ -27496,7 +27522,7 @@ void input_keyboard_event(bool down, unsigned code,
|
||||
p_rarch->keyboard_line = NULL;
|
||||
|
||||
/* Unblock all hotkeys. */
|
||||
p_rarch->current_input->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -27537,12 +27563,12 @@ static bool input_keyboard_ctl(
|
||||
}
|
||||
|
||||
/* While waiting for input, we have to block all hotkeys. */
|
||||
p_rarch->current_input->keyboard_mapping_blocked = true;
|
||||
p_rarch->keyboard_mapping_blocked = true;
|
||||
break;
|
||||
case RARCH_INPUT_KEYBOARD_CTL_CANCEL_WAIT_KEYS:
|
||||
p_rarch->keyboard_press_cb = NULL;
|
||||
p_rarch->keyboard_press_data = NULL;
|
||||
p_rarch->current_input->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
break;
|
||||
case RARCH_INPUT_KEYBOARD_CTL_IS_LINEFEED_ENABLED:
|
||||
return p_rarch->input_driver_keyboard_linefeed_enable;
|
||||
@ -31626,7 +31652,7 @@ static void video_driver_free_internal(void)
|
||||
#endif
|
||||
p_rarch->joypad = NULL;
|
||||
}
|
||||
p_rarch->current_input->keyboard_mapping_blocked = false;
|
||||
p_rarch->keyboard_mapping_blocked = false;
|
||||
}
|
||||
p_rarch->current_input_data = NULL;
|
||||
}
|
||||
@ -34755,7 +34781,8 @@ static void driver_adjust_system_rates(struct rarch_state *p_rarch)
|
||||
unsigned video_swap_interval = settings->uints.video_swap_interval;
|
||||
|
||||
if (p_rarch->current_video->set_nonblock_state)
|
||||
p_rarch->current_video->set_nonblock_state(p_rarch->video_driver_data, true,
|
||||
p_rarch->current_video->set_nonblock_state(
|
||||
p_rarch->video_driver_data, true,
|
||||
video_driver_test_all_flags(GFX_CTX_FLAGS_ADAPTIVE_VSYNC) &&
|
||||
video_adaptive_vsync,
|
||||
video_swap_interval
|
||||
@ -38783,7 +38810,7 @@ static enum runloop_state runloop_check_state(
|
||||
p_rarch->input_driver_block_libretro_input = false;
|
||||
p_rarch->input_driver_block_hotkey = false;
|
||||
|
||||
if (p_rarch->current_input->keyboard_mapping_blocked)
|
||||
if (p_rarch->keyboard_mapping_blocked)
|
||||
p_rarch->input_driver_block_hotkey = true;
|
||||
|
||||
{
|
||||
@ -38909,7 +38936,9 @@ static enum runloop_state runloop_check_state(
|
||||
p_rarch->current_input_data,
|
||||
p_rarch->joypad,
|
||||
sec_joypad,
|
||||
&joypad_info, &binds, port,
|
||||
&joypad_info, &binds,
|
||||
p_rarch->keyboard_mapping_blocked,
|
||||
port,
|
||||
RETRO_DEVICE_KEYBOARD, 0, ids[i][0]))
|
||||
BIT256_SET_PTR(¤t_bits, ids[i][1]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user