Don't need this anymore

This commit is contained in:
twinaphex 2015-11-07 20:59:12 +01:00
parent e2ced6bd6a
commit 22f85b11df
19 changed files with 56 additions and 149 deletions

View File

@ -949,25 +949,20 @@ static int16_t android_input_state(void *data,
return 0;
}
static bool android_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool android_input_key_pressed(void *data, int key)
{
android_input_t *android = (android_input_t*)data;
settings_t *settings = config_get_ptr();
if (input_joypad_pressed(android->joypad,
0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool android_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool android_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -396,29 +396,21 @@ static int16_t cocoa_input_state(void *data,
return 0;
}
static bool cocoa_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool cocoa_input_key_pressed(void *data, int key)
{
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
settings_t *settings = config_get_ptr();
if (cocoa_input_is_pressed(apple, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_KEYBOARD;
return true;
}
if (input_joypad_pressed(apple->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool cocoa_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool cocoa_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -83,27 +83,21 @@ static void* ctr_input_initialize(void)
return ctr;
}
static bool ctr_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool ctr_input_key_pressed(void *data, int key)
{
settings_t *settings = config_get_ptr();
ctr_input_t *ctr = (ctr_input_t*)data;
if (input_joypad_pressed(ctr->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool ctr_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool ctr_input_meta_key_pressed(void *data, int key)
{
if (BIT64_GET(lifecycle_state, key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}

View File

@ -351,23 +351,18 @@ static bool dinput_keyboard_pressed(struct dinput_input *di, unsigned key)
static bool dinput_is_pressed(struct dinput_input *di,
const struct retro_keybind *binds,
unsigned port, unsigned id, enum input_device_type *device)
unsigned port, unsigned id)
{
const struct retro_keybind *bind = &binds[id];
bool joypad_pressed = false;
bool keyboard_pressed = false;
if (id >= RARCH_BIND_LIST_END)
return false;
keyboard_pressed = !di->blocked && dinput_keyboard_pressed(di, bind->key);
joypad_pressed = input_joypad_pressed(di->joypad, port, binds, id);
if (!di->blocked && dinput_keyboard_pressed(di, bind->key))
return true;
if (input_joypad_pressed(di->joypad, port, binds, id))
return true;
if (keyboard_pressed)
*device = INPUT_DEVICE_TYPE_KEYBOARD;
if (joypad_pressed)
*device = INPUT_DEVICE_TYPE_JOYPAD;
return keyboard_pressed || joypad_pressed;
return false;
}
static int16_t dinput_pressed_analog(struct dinput_input *di,
@ -394,15 +389,14 @@ static int16_t dinput_pressed_analog(struct dinput_input *di,
return pressed_plus + pressed_minus;
}
static bool dinput_key_pressed(void *data, int key, enum input_device_type *device)
static bool dinput_key_pressed(void *data, int key)
{
settings_t *settings = config_get_ptr();
return dinput_is_pressed((struct dinput_input*)data, settings->input.binds[0], 0, key, device);
return dinput_is_pressed((struct dinput_input*)data, settings->input.binds[0], 0, key);
}
static bool dinput_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool dinput_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}
@ -571,7 +565,7 @@ static int16_t dinput_input_state(void *data,
return dinput_mouse_state(di, id);
case RARCH_DEVICE_MOUSE_SCREEN:
return dinput_mouse_state_screen(di, id);
return dinput_mouse_state_screen(di, id);
case RETRO_DEVICE_POINTER:
case RARCH_DEVICE_POINTER_SCREEN:

View File

@ -93,27 +93,21 @@ static void gx_input_poll(void *data)
gx->joypad->poll();
}
static bool gx_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool gx_input_key_pressed(void *data, int key)
{
settings_t *settings = config_get_ptr();
gx_input_t *gx = (gx_input_t*)data;
if (input_joypad_pressed(gx->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool gx_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool gx_input_meta_key_pressed(void *data, int key)
{
if (BIT64_GET(lifecycle_state, key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}

View File

@ -173,29 +173,22 @@ static int16_t linuxraw_analog_pressed(linuxraw_input_t *linuxraw,
return pressed_plus + pressed_minus;
}
static bool linuxraw_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool linuxraw_input_key_pressed(void *data, int key)
{
linuxraw_input_t *linuxraw = (linuxraw_input_t*)data;
settings_t *settings = config_get_ptr();
if (linuxraw_is_pressed(linuxraw, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_KEYBOARD;
return true;
}
if (input_joypad_pressed(linuxraw->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool linuxraw_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool linuxraw_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -41,20 +41,18 @@ static int16_t nullinput_input_state(void *data,
return 0;
}
static bool nullinput_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool nullinput_input_key_pressed(void *data, int key)
{
(void)data;
(void)key;
(void)device;
return false;
}
static bool nullinput_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool nullinput_input_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
(void)device;
return false;
}

View File

@ -174,24 +174,19 @@ static void* ps3_input_init(void)
return ps3;
}
static bool ps3_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool ps3_input_key_pressed(void *data, int key)
{
ps3_input_t *ps3 = (ps3_input_t*)data;
settings_t *settings = config_get_ptr();
if (input_joypad_pressed(ps3->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool ps3_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool ps3_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -100,28 +100,20 @@ static void* psp_input_initialize(void)
return psp;
}
static bool psp_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool psp_input_key_pressed(void *data, int key)
{
settings_t *settings = config_get_ptr();
psp_input_t *psp = (psp_input_t*)data;
if (input_joypad_pressed(psp->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool psp_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool psp_input_meta_key_pressed(void *data, int key)
{
bool meta_pressed = (BIT64_GET(lifecycle_state, key));
if (meta_pressed)
*device = INPUT_DEVICE_TYPE_JOYPAD;
return meta_pressed;
return (BIT64_GET(lifecycle_state, key));
}
static uint64_t psp_input_get_capabilities(void *data)

View File

@ -786,23 +786,19 @@ static int16_t qnx_input_state(void *data,
return 0;
}
static bool qnx_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool qnx_input_key_pressed(void *data, int key)
{
qnx_input_t *qnx = (qnx_input_t*)data;
settings_t *settings = config_get_ptr();
if (input_joypad_pressed(qnx->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool qnx_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool qnx_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -67,29 +67,26 @@ error:
return NULL;
}
static bool rwebinput_key_pressed(void *data, int key, enum input_device_type *device)
static bool rwebinput_key_pressed(void *data, int key)
{
unsigned sym;
bool ret;
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
if (key >= RETROK_LAST)
return false;
sym = input_keymaps_translate_rk_to_keysym((enum retro_key)key);
ret = rwebinput->state.keys[sym >> 3] & (1 << (sym & 7));
if (ret)
*device = INPUT_DEVICE_TYPE_KEYBOARD;
if (rwebinput->state.keys[sym >> 3] & (1 << (sym & 7)))
return true;
return ret;
return false;
}
static bool rwebinput_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool rwebinput_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
(void)device;
return false;
}

View File

@ -281,7 +281,7 @@ static int16_t sdl_analog_pressed(sdl_input_t *sdl, const struct retro_keybind *
return pressed_plus + pressed_minus;
}
static bool sdl_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool sdl_input_key_pressed(void *data, int key)
{
if (key >= 0 && key < RARCH_BIND_LIST_END)
{
@ -290,22 +290,16 @@ static bool sdl_input_key_pressed(void *data, int key, enum input_device_type *d
const struct retro_keybind *binds = settings->input.binds[0];
if (sdl_is_pressed(sdl, 0, binds, key))
{
*device = INPUT_DEVICE_TYPE_KEYBOARD;
return true;
}
if (input_joypad_pressed(sdl->joypad, 0, binds, key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
}
return false;
}
static bool sdl_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool sdl_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -596,29 +596,21 @@ static int16_t udev_input_state(void *data, const struct retro_keybind **binds,
return 0;
}
static bool udev_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool udev_input_key_pressed(void *data, int key)
{
udev_input_t *udev = (udev_input_t*)data;
settings_t *settings = config_get_ptr();
if (udev_input_is_pressed(udev, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_KEYBOARD;
return true;
}
if (input_joypad_pressed(udev->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool udev_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool udev_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -257,24 +257,21 @@ static int16_t x_pressed_analog(x11_input_t *x11,
return pressed_plus + pressed_minus;
}
static bool x_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool x_input_key_pressed(void *data, int key)
{
x11_input_t *x11 = (x11_input_t*)data;
settings_t *settings = config_get_ptr();
bool keyboard_pressed = x_is_pressed(x11, settings->input.binds[0], key);
bool joypad_pressed = input_joypad_pressed(x11->joypad, 0, settings->input.binds[0], key);
if (keyboard_pressed)
*device = INPUT_DEVICE_TYPE_KEYBOARD;
if (joypad_pressed)
*device = INPUT_DEVICE_TYPE_JOYPAD;
if (x_is_pressed(x11, settings->input.binds[0], key))
return true;
if (input_joypad_pressed(x11->joypad, 0, settings->input.binds[0], key))
return true;
return keyboard_pressed || joypad_pressed;
return false;
}
static bool x_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool x_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -88,23 +88,19 @@ static void *xdk_input_init(void)
return xdk;
}
static bool xdk_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool xdk_input_key_pressed(void *data, int key)
{
xdk_input_t *xdk = (xdk_input_t*)data;
settings_t *settings = config_get_ptr();
if (input_joypad_pressed(xdk->joypad, 0, settings->input.binds[0], key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool xdk_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool xdk_input_meta_key_pressed(void *data, int key)
{
(void)device;
return false;
}

View File

@ -88,27 +88,17 @@ static void* xenon360_input_init(void)
return (void*)-1;
}
static bool xenon360_input_key_pressed(void *data, int key, enum input_device_type *device)
static bool xenon360_input_key_pressed(void *data, int key)
{
(void)device;
if (lifecycle_state & (UINT64_C(1) << key))
{
*device = INPUT_DEVICE_TYPE_JOYPAD;
return true;
}
return false;
}
static bool xenon360_input_meta_key_pressed(void *data, int key, enum input_device_type *device)
static bool xenon360_input_meta_key_pressed(void *data, int key)
{
bool meta_pressed = (lifecycle_state & (UINT64_C(1) << key));
if (meta_pressed)
*device = INPUT_DEVICE_TYPE_JOYPAD;
return meta_pressed;
return (lifecycle_state & (UINT64_C(1) << key));
}
static uint64_t xenon360_input_get_capabilities(void *data)

View File

@ -174,13 +174,12 @@ retro_input_t input_driver_keys_pressed(void)
for (key = 0; key < RARCH_BIND_LIST_END; key++)
{
bool state = false;
enum input_device_type device = INPUT_DEVICE_TYPE_NONE;
if ((!driver->block_libretro_input && ((key < RARCH_FIRST_META_KEY)))
|| !driver->block_hotkey)
state = input->key_pressed(driver->input_data, key, &device);
state = input->key_pressed(driver->input_data, key);
if (key >= RARCH_FIRST_META_KEY)
state |= input->meta_key_pressed(driver->input_data, key, &device);
state |= input->meta_key_pressed(driver->input_data, key);
#ifdef HAVE_OVERLAY
state |= input_overlay_key_pressed(key);

View File

@ -74,8 +74,8 @@ typedef struct input_driver
int16_t (*input_state)(void *data,
const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
bool (*key_pressed)(void *data, int key, enum input_device_type *device);
bool (*meta_key_pressed)(void *data, int key, enum input_device_type *device);
bool (*key_pressed)(void *data, int key);
bool (*meta_key_pressed)(void *data, int key);
void (*free)(void *data);
bool (*set_sensor_state)(void *data, unsigned port,
enum retro_sensor_action action, unsigned rate);

View File

@ -660,7 +660,6 @@ static INLINE retro_input_t input_keys_pressed(driver_t *driver,
unsigned i;
const struct retro_keybind *binds[MAX_USERS];
retro_input_t ret = 0;
enum input_device_type device = INPUT_DEVICE_TYPE_NONE;
for (i = 0; i < MAX_USERS; i++)
binds[i] = settings->input.binds[i];
@ -672,7 +671,7 @@ static INLINE retro_input_t input_keys_pressed(driver_t *driver,
driver->block_libretro_input = check_block_hotkey(driver,
settings, driver->input->key_pressed(
driver->input_data, RARCH_ENABLE_HOTKEY, &device));
driver->input_data, RARCH_ENABLE_HOTKEY));
for (i = 0; i < settings->input.max_users; i++)