#include <stdlib.h>
#include <string.h>
-#include "common.h"
#include "input.h"
#include "plat.h"
#include "../linux/in_evdev.h"
static in_dev_t in_devices[IN_MAX_DEVS];
static int in_dev_count = 0;
static int in_have_async_devs = 0;
+static int menu_key_state = 0;
+static int menu_last_used_dev = 0;
#define DRV(id) in_drivers[(unsigned)(id) < IN_DRVID_COUNT ? (id) : 0]
return result;
}
-static int menu_key_state = 0;
-
void in_set_blocking(int is_blocking)
{
int i, ret;
break;
if (code < 0)
continue;
+ menu_last_used_dev = dev_id;
if (keys_old != menu_key_state)
break;
}
static char xname[16];
const char *name;
+ if (dev_id < 0) /* want last used dev? */
+ dev_id = menu_last_used_dev;
+
if (dev_id < 0 || dev_id >= IN_MAX_DEVS)
return "Unkn0";
+ if (keycode < 0) /* want name for menu key? */
+ keycode = DRV(in_devices[dev_id].drv_id).menu_translate(keycode);
+
name = DRV(in_devices[dev_id].drv_id).get_key_name(keycode);
if (name != NULL)
return name;