Revert "Move set_keybinds autoconfiguration (that is done on every console"

This reverts commit c26653fca83af90fc14bd2fca0324bfaf1a1156f.
This commit is contained in:
twinaphex 2013-03-16 17:51:37 +01:00
parent d67e4da4db
commit f028a8555e
5 changed files with 121 additions and 32 deletions

View File

@ -895,44 +895,12 @@ void init_video_input(void)
RARCH_ERR("Cannot init input driver. Exiting ...\n");
rarch_fail(1, "init_video_input()");
}
}
else
{
RARCH_ERR("Cannot find input driver. Exiting ...\n");
rarch_fail(1, "init_video_input()");
}
if (driver.input != NULL)
{
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
unsigned action = 0;
if (driver.input->set_keybinds)
action |= (1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS);
switch (g_settings.input.dpad_emulation[i])
{
case ANALOG_DPAD_LSTICK:
action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
action |= (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (action)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
action);
}
}
}
#ifdef HAVE_OVERLAY

View File

@ -446,6 +446,37 @@ static void *gx_input_init(void)
SYS_SetPowerCallback(power_callback);
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
(1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
unsigned keybind_action = 0;
switch (g_settings.input.dpad_emulation[i])
{
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (keybind_action)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
keybind_action);
}
return (void*)-1;
}

View File

@ -513,6 +513,36 @@ static void* ps3_input_init(void)
cellMouseInit(MAX_MICE);
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
(1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
unsigned keybind_action = 0;
switch (g_settings.input.dpad_emulation[i])
{
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (keybind_action)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
keybind_action);
}
return (void*)-1;
}

View File

@ -167,6 +167,36 @@ static void* psp_input_initialize(void)
#endif
sceCtrlSetSamplingMode(DEFAULT_SAMPLING_MODE);
for(unsigned i = 0; i < MAX_PLAYERS; i++)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
(1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
unsigned keybind_action = 0;
switch (g_settings.input.dpad_emulation[i])
{
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (keybind_action)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
action);
}
return (void*)-1;
}

View File

@ -399,6 +399,36 @@ static void *xdk_input_init(void)
while(XGetDeviceEnumerationStatus() == XDEVICE_ENUMERATION_BUSY) {}
#endif
for(unsigned i = 0; i < MAX_PLAYERS; i++)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
(1ULL << KEYBINDS_ACTION_SET_DEFAULT_BINDS));
for(unsigned i = 0; i < MAX_PLAYERS; i++)
{
unsigned keybind_action = 0;
switch (g_settings.input.dpad_emulation[i])
{
case ANALOG_DPAD_LSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_LSTICK);
break;
case ANALOG_DPAD_RSTICK:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_RSTICK);
break;
case ANALOG_DPAD_NONE:
keybind_action = (1ULL << KEYBINDS_ACTION_SET_ANALOG_DPAD_NONE);
break;
default:
break;
}
if (keybind_action)
if (driver.input->set_keybinds)
driver.input->set_keybinds(driver.input_data, 0, i, 0,
keybind_action);
}
return (void*)-1;
}