Create meta_key_pressed

This commit is contained in:
twinaphex 2015-07-17 03:31:51 +02:00
parent 8162b77bae
commit 450c665619
18 changed files with 108 additions and 9 deletions

View File

@ -879,6 +879,11 @@ static bool android_input_key_pressed(void *data, int key)
0, settings->input.binds[0], key);
}
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;
@ -1024,6 +1029,7 @@ input_driver_t input_android = {
android_input_poll,
android_input_state,
android_input_key_pressed,
android_input_meta_key_pressed,
android_input_free_input,
android_input_set_sensor_state,
android_input_get_sensor_input,

View File

@ -369,6 +369,11 @@ static bool cocoa_input_key_pressed(void *data, int key)
input_joypad_pressed(apple->joypad, 0, settings->input.binds[0], key);
}
static bool cocoa_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void cocoa_input_free(void *data)
{
cocoa_input_data_t *apple = (cocoa_input_data_t*)data;
@ -442,6 +447,7 @@ input_driver_t input_cocoa = {
cocoa_input_poll,
cocoa_input_state,
cocoa_input_key_pressed,
cocoa_input_meta_key_pressed,
cocoa_input_free,
NULL,
NULL,

View File

@ -88,8 +88,12 @@ static bool ctr_input_key_pressed(void *data, int key)
settings_t *settings = config_get_ptr();
ctr_input_t *ctr = (ctr_input_t*)data;
return (BIT64_GET(lifecycle_state, key)) ||
(input_joypad_pressed(ctr->joypad, 0, settings->input.binds[0], key);
return (input_joypad_pressed(ctr->joypad, 0, settings->input.binds[0], key);
}
static bool ctr_input_meta_key_pressed(void *data, int key)
{
return (BIT64_GET(lifecycle_state, key));
}
static uint64_t ctr_input_get_capabilities(void *data)
@ -145,6 +149,7 @@ input_driver_t input_ctr = {
ctr_input_poll,
ctr_input_state,
ctr_input_key_pressed,
ctr_input_meta_key_pressed,
ctr_input_free_input,
NULL,
NULL,

View File

@ -383,6 +383,11 @@ static bool dinput_key_pressed(void *data, int key)
settings->input.binds[0], 0, key);
}
static bool dinput_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t dinput_lightgun_state(struct dinput_input *di, unsigned id)
{
switch (id)
@ -802,6 +807,7 @@ input_driver_t input_dinput = {
dinput_poll,
dinput_input_state,
dinput_key_pressed,
dinput_meta_key_pressed,
dinput_free,
NULL,
NULL,

View File

@ -97,8 +97,12 @@ static bool gx_input_key_pressed(void *data, int key)
{
settings_t *settings = config_get_ptr();
gx_input_t *gx = (gx_input_t*)data;
return (BIT64_GET(lifecycle_state, key)) ||
input_joypad_pressed(gx->joypad, 0, settings->input.binds[0], key);
return input_joypad_pressed(gx->joypad, 0, settings->input.binds[0], key);
}
static bool gx_input_meta_key_pressed(void *data, int key)
{
return (BIT64_GET(lifecycle_state, key));
}
static uint64_t gx_input_get_capabilities(void *data)
@ -154,6 +158,7 @@ input_driver_t input_gx = {
gx_input_poll,
gx_input_state,
gx_input_key_pressed,
gx_input_meta_key_pressed,
gx_input_free_input,
NULL,
NULL,

View File

@ -182,6 +182,11 @@ static bool linuxraw_input_key_pressed(void *data, int key)
input_joypad_pressed(linuxraw->joypad, 0, settings->input.binds[0], key);
}
static bool linuxraw_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t linuxraw_input_state(void *data,
const struct retro_keybind **binds, unsigned port,
unsigned device, unsigned idx, unsigned id)
@ -302,6 +307,7 @@ input_driver_t input_linuxraw = {
linuxraw_input_poll,
linuxraw_input_state,
linuxraw_input_key_pressed,
linuxraw_input_meta_key_pressed,
linuxraw_input_free,
NULL,
NULL,

View File

@ -49,6 +49,14 @@ static bool nullinput_input_key_pressed(void *data, int key)
return false;
}
static bool nullinput_input_meta_key_pressed(void *data, int key)
{
(void)data;
(void)key;
return false;
}
static void nullinput_input_free_input(void *data)
{
(void)data;
@ -91,6 +99,7 @@ input_driver_t input_null = {
nullinput_input_poll,
nullinput_input_state,
nullinput_input_key_pressed,
nullinput_input_meta_key_pressed,
nullinput_input_free_input,
nullinput_set_sensor_state,
NULL,

View File

@ -182,6 +182,11 @@ static bool ps3_input_key_pressed(void *data, int key)
return input_joypad_pressed(ps3->joypad, 0, settings->input.binds[0], key);
}
static bool ps3_input_meta_key_pressed(void *data, int key)
{
return false;
}
static uint64_t ps3_input_get_capabilities(void *data)
{
(void)data;
@ -265,6 +270,7 @@ input_driver_t input_ps3 = {
ps3_input_poll,
ps3_input_state,
ps3_input_key_pressed,
ps3_input_meta_key_pressed,
ps3_input_free_input,
ps3_input_set_sensor_state,
NULL,

View File

@ -103,8 +103,12 @@ static bool psp_input_key_pressed(void *data, int key)
settings_t *settings = config_get_ptr();
psp_input_t *psp = (psp_input_t*)data;
return (BIT64_GET(lifecycle_state, key)) ||
input_joypad_pressed(psp->joypad, 0, settings->input.binds[0], key);
return input_joypad_pressed(psp->joypad, 0, settings->input.binds[0], key);
}
static bool psp_input_meta_key_pressed(void *data, int key)
{
return (BIT64_GET(lifecycle_state, key));
}
static uint64_t psp_input_get_capabilities(void *data)
@ -160,6 +164,7 @@ input_driver_t input_psp = {
psp_input_poll,
psp_input_state,
psp_input_key_pressed,
psp_input_meta_key_pressed,
psp_input_free_input,
NULL,
NULL,

View File

@ -794,6 +794,11 @@ static bool qnx_input_key_pressed(void *data, int key)
return input_joypad_pressed(qnx->joypad, 0, settings->input.binds[0], key);
}
static bool qnx_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void qnx_input_free_input(void *data)
{
if (data)
@ -859,6 +864,7 @@ input_driver_t input_qnx = {
qnx_input_poll,
qnx_input_state,
qnx_input_key_pressed,
NULL,
qnx_input_free_input,
NULL,
NULL,

View File

@ -82,6 +82,11 @@ static bool rwebinput_key_pressed(rwebinput_input_t *rwebinput, int key)
return ret;
}
static bool rwebinput_meta_key_pressed(rwebinput_input_t *rwebinput, int key)
{
return false;
}
static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
const struct retro_keybind *binds, unsigned id)
{
@ -97,7 +102,7 @@ static bool rwebinput_is_pressed(rwebinput_input_t *rwebinput,
static bool rwebinput_key_pressed(void *data, int key)
{
rwebinput_input_t *rwebinput = (rwebinput_input_t*)data;
settings_t *settings = config_get_ptr();
settings_t *settings = config_get_ptr();
return rwebinput_is_pressed(rwebinput, settings->input.binds[0], key);
}
@ -250,6 +255,7 @@ input_driver_t input_rwebinput = {
rwebinput_input_poll,
rwebinput_input_state,
rwebinput_key_pressed,
rwebinput_meta_key_pressed,
rwebinput_input_free,
NULL,
NULL,

View File

@ -291,6 +291,11 @@ static bool sdl_input_key_pressed(void *data, int key)
return false;
}
static bool sdl_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t sdl_joypad_device_state(sdl_input_t *sdl, const struct retro_keybind **binds_,
unsigned port_num, unsigned id)
{
@ -583,6 +588,7 @@ input_driver_t input_sdl = {
sdl_input_poll,
sdl_input_state,
sdl_input_key_pressed,
sdl_input_meta_key_pressed,
sdl_input_free,
NULL,
NULL,

View File

@ -561,6 +561,11 @@ static bool udev_input_key_pressed(void *data, int key)
input_joypad_pressed(udev->joypad, 0, settings->input.binds[0], key);
}
static bool udev_input_meta_key_pressed(void *data, int key)
{
return false;
}
static void udev_input_free(void *data)
{
unsigned i;
@ -881,6 +886,7 @@ input_driver_t input_udev = {
udev_input_poll,
udev_input_state,
udev_input_key_pressed,
udev_input_meta_key_pressed,
udev_input_free,
NULL,
NULL,

View File

@ -265,6 +265,11 @@ static bool x_input_key_pressed(void *data, int key)
input_joypad_pressed(x11->joypad, 0, settings->input.binds[0], key);
}
static bool x_input_meta_key_pressed(void *data, int key)
{
return false;
}
static int16_t x_mouse_state(x11_input_t *x11, unsigned id)
{
switch (id)
@ -546,6 +551,7 @@ input_driver_t input_x = {
x_input_poll,
x_input_state,
x_input_key_pressed,
x_input_meta_key_pressed,
x_input_free,
NULL,
NULL,

View File

@ -96,6 +96,11 @@ static bool xdk_input_key_pressed(void *data, int key)
return input_joypad_pressed(xdk->joypad, 0, settings->input.binds[0], key);
}
static bool xdk_input_meta_key_pressed(void *data, int key)
{
return false;
}
static uint64_t xdk_input_get_capabilities(void *data)
{
(void)data;
@ -173,6 +178,7 @@ input_driver_t input_xinput = {
xdk_input_poll,
xdk_input_state,
xdk_input_key_pressed,
xdk_input_meta_key_pressed,
xdk_input_free_input,
NULL,
NULL,

View File

@ -93,6 +93,11 @@ static bool xenon360_input_key_pressed(void *data, int key)
return (lifecycle_state & (UINT64_C(1) << key));
}
static bool xenon360_input_meta_key_pressed(void *data, int key)
{
return (lifecycle_state & (UINT64_C(1) << key));
}
static uint64_t xenon360_get_capabilities(void *data)
{
uint64_t caps = 0;
@ -124,6 +129,7 @@ input_driver_t input_xenon360 = {
xenon360_input_poll,
xenon360_input_state,
xenon360_input_key_pressed,
xenon360_input_meta_key_pressed,
xenon360_input_free_input,
NULL,
NULL,

View File

@ -209,11 +209,13 @@ retro_input_t input_driver_keys_pressed(void)
for (key = 0; key < RARCH_BIND_LIST_END; key++)
{
bool state = false;
if ((!driver->block_libretro_input &&
(((key < RARCH_FIRST_META_KEY) || key == RARCH_MENU_TOGGLE)))
if ((!driver->block_libretro_input && ((key < RARCH_FIRST_META_KEY)))
|| !driver->block_hotkey)
state = input->key_pressed(driver->input_data, key);
if (key >= RARCH_FIRST_META_KEY)
state |= input->meta_key_pressed(driver->input_data, key);
#ifdef HAVE_OVERLAY
state |= input_overlay_key_pressed(key);
#endif

View File

@ -64,6 +64,7 @@ typedef struct input_driver
const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
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);