Rearrange input state input drivers for ANALOG - do joypad

processing first, then keyboard second
This commit is contained in:
twinaphex 2020-06-13 05:25:10 +02:00
parent dd79629015
commit c7cd327b5b
9 changed files with 37 additions and 26 deletions

View File

@ -345,17 +345,19 @@ static int16_t cocoa_input_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = 0;
#ifdef HAVE_MFI
ret = input_joypad_analog(apple->sec_joypad, joypad_info, port,
idx, id, binds[port]);
#endif
if (!ret && binds[port])
if (!ret)
ret = input_joypad_analog(apple->joypad, joypad_info, port,
idx, id, binds[port]);
return ret;
}
break;
case RETRO_DEVICE_KEYBOARD:
return (id < RETROK_LAST) && apple_key_state[rarch_keysym_lut[(enum retro_key)id]];
case RETRO_DEVICE_MOUSE:

View File

@ -635,10 +635,10 @@ static int16_t dinput_input_state(void *data,
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = dinput_pressed_analog(di, binds[port], idx, id);
if (!ret)
ret = input_joypad_analog(di->joypad, joypad_info,
int16_t ret = input_joypad_analog(di->joypad, joypad_info,
port, idx, id, binds[port]);
if (!ret)
ret = dinput_pressed_analog(di, binds[port], idx, id);
return ret;
}
break;

View File

@ -161,11 +161,12 @@ static int16_t linuxraw_input_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = linuxraw_analog_pressed(linuxraw, binds[port], idx, id);
if (!ret && binds[port])
ret = input_joypad_analog(linuxraw->joypad,
joypad_info, port, idx, id, binds[port]);
int16_t ret = input_joypad_analog(linuxraw->joypad,
joypad_info, port, idx, id, binds[port]);
if (!ret)
ret = linuxraw_analog_pressed(linuxraw, binds[port], idx, id);
return ret;
}
}

View File

@ -565,13 +565,15 @@ static int16_t rwebinput_input_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = rwebinput_analog_pressed(
int16_t ret = input_joypad_analog(
rwebinput->joypad, joypad_info, port,
idx, id, binds[port]);
if (!ret)
ret = rwebinput_analog_pressed(
rwebinput, joypad_info, binds[port],
idx, id);
if (!ret && binds[port])
ret = input_joypad_analog(rwebinput->joypad, joypad_info, port,
idx, id, binds[port]);
return ret;
}
case RETRO_DEVICE_KEYBOARD:

View File

@ -235,10 +235,10 @@ static int16_t sdl_input_state(void *data,
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = sdl_analog_pressed(sdl, binds[port], idx, id);
if (!ret)
ret = input_joypad_analog(sdl->joypad,
int16_t ret = input_joypad_analog(sdl->joypad,
joypad_info, port, idx, id, binds[port]);
if (!ret)
ret = sdl_analog_pressed(sdl, binds[port], idx, id);
return ret;
}
break;

View File

@ -1048,11 +1048,12 @@ static int16_t udev_input_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = udev_analog_pressed(binds[port], idx, id);
if (!ret && binds[port])
ret = input_joypad_analog(udev->joypad,
int16_t ret = input_joypad_analog(udev->joypad,
joypad_info, port, idx, id, binds[port]);
if (!ret)
ret = udev_analog_pressed(binds[port], idx, id);
return ret;
}
case RETRO_DEVICE_KEYBOARD:

View File

@ -215,6 +215,7 @@ static int16_t uwp_input_state(void *data,
case RETRO_DEVICE_ANALOG:
if (binds[port])
return uwp_pressed_analog(uwp, joypad_info, binds[port], port, index, id);
break;
case RETRO_DEVICE_KEYBOARD:
return (id < RETROK_LAST) && uwp_keyboard_pressed(id);

View File

@ -333,12 +333,15 @@ static int16_t input_wl_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = input_wl_analog_pressed(wl, binds[port], idx, id);
if (!ret && binds[port])
ret = input_joypad_analog(wl->joypad, joypad_info, port, idx, id, binds[port]);
int16_t ret = input_joypad_analog(
wl->joypad, joypad_info, port, idx, id, binds[port]);
if (!ret)
ret = input_wl_analog_pressed(wl, binds[port], idx, id);
return ret;
}
break;
case RETRO_DEVICE_KEYBOARD:
return input_wl_state_kb(wl, binds, port, device, idx, id);
case RETRO_DEVICE_MOUSE:

View File

@ -351,12 +351,13 @@ static int16_t x_input_state(void *data,
}
break;
case RETRO_DEVICE_ANALOG:
if (binds[port])
{
int16_t ret = x_pressed_analog(x11, binds[port], idx, id);
if (!ret && binds[port])
ret = input_joypad_analog(x11->joypad, joypad_info,
port, idx,
id, binds[port]);
int16_t ret = input_joypad_analog(x11->joypad, joypad_info,
port, idx,
id, binds[port]);
if (!ret)
ret = x_pressed_analog(x11, binds[port], idx, id);
return ret;
}
case RETRO_DEVICE_KEYBOARD: