mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Fix rwebinput driver
input/drivers/rwebinput_input.c: - rwebinput_key_pressed() was defined twice. Not sure why, but removed the first instance of it. - in rwebinput_input_state() the device was hardcoded to INPUT_DEVICE_TYPE_NONE which would result in it always returning 0
This commit is contained in:
parent
83d63fcdd1
commit
e5b0a5858a
@ -103,13 +103,6 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool rwebinput_key_pressed(void *data, int key)
|
|
||||||
{
|
|
||||||
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
return rwebinput_is_pressed(rwebinput, settings->input.binds[0], key);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int16_t rwebinput_mouse_state(rwebinput_input_t *rwebinput, unsigned id)
|
static int16_t rwebinput_mouse_state(rwebinput_input_t *rwebinput, unsigned id)
|
||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -147,7 +140,6 @@ static int16_t rwebinput_analog_pressed(rwebinput_input_t *rwebinput,
|
|||||||
static int16_t rwebinput_input_state(void *data, const struct retro_keybind **binds,
|
static int16_t rwebinput_input_state(void *data, const struct retro_keybind **binds,
|
||||||
unsigned port, unsigned device, unsigned idx, unsigned id)
|
unsigned port, unsigned device, unsigned idx, unsigned id)
|
||||||
{
|
{
|
||||||
enum input_device_type device = INPUT_DEVICE_TYPE_NONE;
|
|
||||||
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
|
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
|
||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
@ -159,7 +151,7 @@ static int16_t rwebinput_input_state(void *data, const struct retro_keybind **bi
|
|||||||
return rwebinput_analog_pressed(rwebinput, binds[port], idx, id);
|
return rwebinput_analog_pressed(rwebinput, binds[port], idx, id);
|
||||||
|
|
||||||
case RETRO_DEVICE_KEYBOARD:
|
case RETRO_DEVICE_KEYBOARD:
|
||||||
return rwebinput_key_pressed(rwebinput, id, &device);
|
return rwebinput_key_pressed(rwebinput, id);
|
||||||
|
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
return rwebinput_mouse_state(rwebinput, id);
|
return rwebinput_mouse_state(rwebinput, id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user