defbinds = DRV(drv_id).defbinds;
if (defbinds != NULL) {
for (i = 0; ; i++) {
- if (defbinds[i].bit == 0 && defbinds[i].code == 0)
+ if (defbinds[i].bit == 0 && defbinds[i].btype == 0
+ && defbinds[i].bit == 0)
break;
binds[IN_BIND_OFFS(defbinds[i].code, defbinds[i].btype)] =
1 << defbinds[i].bit;
for (i = 0; i < in_driver_count; i++) {
in_probe_dev_id = i;
- in_drivers[i].probe();
+ in_drivers[i].probe(&DRV(i));
}
/* get rid of devs without binds and probes */
int in_menu_wait_any(char *charcode, int timeout_ms)
{
int keys_old = menu_key_state;
+ int ret;
while (1)
{
}
}
- return menu_key_state;
+ ret = menu_key_state;
+ menu_key_state &= ~PBTN_CHAR;
+ return ret;
}
/* wait for menu input, do autorepeat */
if (d.f == NULL) d.f = in_def_##f
/* to be called by drivers */
-int in_register_driver(const in_drv_t *drv, const struct in_default_bind *defbinds)
+int in_register_driver(const in_drv_t *drv,
+ const struct in_default_bind *defbinds, const void *pdata)
{
int count_new = in_driver_count + 1;
in_drv_t *new_drivers;
CHECK_ADD_STUB(new_drivers[in_driver_count], menu_translate);
CHECK_ADD_STUB(new_drivers[in_driver_count], get_key_code);
CHECK_ADD_STUB(new_drivers[in_driver_count], get_key_name);
- if (defbinds != NULL)
+ if (pdata)
+ new_drivers[in_driver_count].pdata = pdata;
+ if (defbinds)
new_drivers[in_driver_count].defbinds = defbinds;
in_drivers = new_drivers;
in_driver_count = count_new;