Put input_jpyad_init_driver last in 'input' callback function

This commit is contained in:
twinaphex 2020-08-29 20:46:42 +02:00
parent bf06d67a30
commit b3744c3126
12 changed files with 32 additions and 26 deletions

View File

@ -524,7 +524,6 @@ static void *android_input_init(const char *joypad_driver)
android->pads_connected = 0;
android->quick_tap_time = 0;
android->joypad = input_joypad_init_driver(joypad_driver, android);
input_keymaps_init_keyboard_lut(rarch_key_map_android);
@ -547,6 +546,8 @@ static void *android_input_init(const char *joypad_driver)
android_app->input_alive = true;
android->joypad = input_joypad_init_driver(joypad_driver, android);
return android;
}

View File

@ -182,12 +182,13 @@ static void *dinput_init(const char *joypad_driver)
}
input_keymaps_init_keyboard_lut(rarch_key_map_dinput);
di->joypad = input_joypad_init_driver(joypad_driver, di);
#ifndef _XBOX
win32_set_input_userdata(di);
#endif
di->joypad = input_joypad_init_driver(joypad_driver, di);
return di;
}

View File

@ -145,12 +145,10 @@ static void* dos_input_init(const char *joypad_driver)
if (!dos)
return NULL;
dos_keyboard_free();
input_keymaps_init_keyboard_lut(rarch_key_map_dos);
dos->joypad = input_joypad_init_driver(joypad_driver, dos);
input_keymaps_init_keyboard_lut(rarch_key_map_dos);
return dos;
}

View File

@ -216,13 +216,14 @@ static void *gx_input_init(const char *joypad_driver)
if (!gx)
return NULL;
gx->joypad = input_joypad_init_driver(joypad_driver, gx);
#ifdef HW_RVL
/* Allocate at least 1 mouse at startup */
gx->mouse_max = 1;
gx->mouse = (gx_input_mouse_t*)calloc(
gx->mouse_max, sizeof(gx_input_mouse_t));
#endif
gx->joypad = input_joypad_init_driver(joypad_driver, gx);
return gx;
}

View File

@ -66,11 +66,12 @@ static void *linuxraw_input_init(const char *joypad_driver)
return NULL;
}
linuxraw->joypad = input_joypad_init_driver(joypad_driver, linuxraw);
input_keymaps_init_keyboard_lut(rarch_key_map_linux);
linux_terminal_claim_stdin();
linuxraw->joypad = input_joypad_init_driver(joypad_driver, linuxraw);
return linuxraw;
}

View File

@ -169,14 +169,15 @@ static void* ps3_input_init(const char *joypad_driver)
if (!ps3)
return NULL;
#ifdef HAVE_MOUSE
cellMouseInit(MAX_MICE);
#endif
ps3->joypad = input_joypad_init_driver(joypad_driver, ps3);
if (ps3->joypad)
ps3->joypad->init(ps3);
#ifdef HAVE_MOUSE
cellMouseInit(MAX_MICE);
#endif
return ps3;
}

View File

@ -270,11 +270,6 @@ static void* ps3_input_init(const char *joypad_driver)
if (!ps3)
return NULL;
ps3->joypad = input_joypad_init_driver(joypad_driver, ps3);
if (ps3->joypad)
ps3->joypad->init(ps3);
/* Keyboard */
input_keymaps_init_keyboard_lut(rarch_key_map_psl1ght);
@ -288,6 +283,11 @@ static void* ps3_input_init(const char *joypad_driver)
ps3_connect_keyboard(ps3, i);
}
ps3->joypad = input_joypad_init_driver(joypad_driver, ps3);
if (ps3->joypad)
ps3->joypad->init(ps3);
return ps3;
}

View File

@ -819,24 +819,22 @@ static void switch_input_free_input(void *data)
static void* switch_input_init(const char *joypad_driver)
{
#ifdef HAVE_LIBNX
unsigned int i;
#endif
switch_input_t *sw = (switch_input_t*) calloc(1, sizeof(*sw));
if (!sw)
return NULL;
#ifdef HAVE_LIBNX
hidInitialize();
#endif
sw->joypad = input_joypad_init_driver(joypad_driver, sw);
#ifdef HAVE_LIBNX
/*
Here we assume that the touch screen is always 1280x720
Call me back when a Nintendo Switch XL is out
*/
input_keymaps_init_keyboard_lut(rarch_key_map_switch);
unsigned int i;
for (i = 0; i <= SWITCH_MAX_SCANCODE; i++)
sw->keyboard_state[i] = false;
@ -860,6 +858,8 @@ static void* switch_input_init(const char *joypad_driver)
sw->sixaxis_handles_count[i] = 0;
#endif
sw->joypad = input_joypad_init_driver(joypad_driver, sw);
return sw;
}

View File

@ -1310,7 +1310,6 @@ static void *udev_input_init(const char *joypad_driver)
if (!udev->num_devices)
RARCH_WARN("[udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event*?\n");
udev->joypad = input_joypad_init_driver(joypad_driver, udev);
input_keymaps_init_keyboard_lut(rarch_key_map_linux);
#ifdef __linux__
@ -1322,6 +1321,8 @@ static void *udev_input_init(const char *joypad_driver)
RARCH_WARN("[udev]: Full-screen pointer won't be available.\n");
#endif
udev->joypad = input_joypad_init_driver(joypad_driver, udev);
return udev;
error:

View File

@ -383,12 +383,13 @@ bool input_wl_init(void *data, const char *joypad_name)
if (!wl)
return false;
input_keymaps_init_keyboard_lut(rarch_key_map_linux);
wl->joypad = input_joypad_init_driver(joypad_name, wl);
if (!wl->joypad)
return false;
input_keymaps_init_keyboard_lut(rarch_key_map_linux);
return true;
}

View File

@ -177,14 +177,14 @@ static void* wiiu_input_init(const char *joypad_driver)
if (!wiiu)
return NULL;
DEBUG_STR(joypad_driver);
wiiu->joypad = input_joypad_init_driver(joypad_driver, wiiu);
KBDSetup(&kb_connection_callback,
&kb_disconnection_callback,&kb_key_callback);
input_keymaps_init_keyboard_lut(rarch_key_map_wiiu);
DEBUG_STR(joypad_driver);
wiiu->joypad = input_joypad_init_driver(joypad_driver, wiiu);
return wiiu;
}

View File

@ -64,9 +64,10 @@ static void *x_input_init(const char *joypad_driver)
x11->display = (Display*)video_driver_display_get();
x11->win = (Window)video_driver_window_get();
x11->joypad = input_joypad_init_driver(joypad_driver, x11);
input_keymaps_init_keyboard_lut(rarch_key_map_x11);
x11->joypad = input_joypad_init_driver(joypad_driver, x11);
return x11;
}