Beispiel #1
0
static void handle_hotplug(unsigned port, uint32_t ptype)
{
   pad_type[port] = ptype;

   if (ptype != WPAD_EXP_NOCONTROLLER)
   {
      if (!input_autoconfigure_connect(
            gx_joypad_name(port),
            NULL,
            gx_joypad.ident,
            port,
            0,
            0
            ))
         input_config_set_device_name(port, gx_joypad_name(port));
   }
}
Beispiel #2
0
static void handle_hotplug(unsigned port, uint32_t ptype)
{
   pad_type[port] = ptype;

   if (ptype != WPAD_EXP_NOCONTROLLER)
   {
      autoconfig_params_t params = {{0}};
      settings_t *settings       = config_get_ptr();

      if (!settings->input.autodetect_enable)
         return;

      strlcpy(settings->input.device_names[port],
            gx_joypad_name(port),
            sizeof(settings->input.device_names[port]));

      /* TODO - implement VID/PID? */
      params.idx = port;
      strlcpy(params.name, gx_joypad_name(port), sizeof(params.name));
      strlcpy(params.driver, gx_joypad.ident, sizeof(params.driver));
      input_config_autoconfigure_joypad(&params);
   }
}