aboutsummaryrefslogtreecommitdiff
path: root/frontend/common
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/common')
-rw-r--r--frontend/common/input.c15
-rw-r--r--frontend/common/input.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/frontend/common/input.c b/frontend/common/input.c
index 2f8a867..a683464 100644
--- a/frontend/common/input.c
+++ b/frontend/common/input.c
@@ -548,8 +548,10 @@ static int in_set_blocking(int is_blocking)
int in_set_config(int dev_id, int what, const void *val, int size)
{
+ const char * const *names;
const int *ival = val;
in_dev_t *dev;
+ int count;
if (what == IN_CFG_BLOCKING)
return in_set_blocking(*ival);
@@ -558,9 +560,10 @@ int in_set_config(int dev_id, int what, const void *val, int size)
if (dev == NULL)
return -1;
- if (what == IN_CFG_KEY_NAMES) {
- const char * const *names = val;
- int count = size / sizeof(names[0]);
+ switch (what) {
+ case IN_CFG_KEY_NAMES:
+ names = val;
+ count = size / sizeof(names[0]);
if (count < dev->key_count) {
lprintf("input: set_key_names: not enough keys\n");
@@ -569,6 +572,12 @@ int in_set_config(int dev_id, int what, const void *val, int size)
dev->key_names = names;
return 0;
+ case IN_CFG_DEFAULT_DEV:
+ /* just set last used dev, for now */
+ menu_last_used_dev = dev_id;
+ return 0;
+ default:
+ break;
}
if (dev->probed)
diff --git a/frontend/common/input.h b/frontend/common/input.h
index 1f90425..da6349b 100644
--- a/frontend/common/input.h
+++ b/frontend/common/input.h
@@ -61,6 +61,7 @@ enum {
IN_CFG_KEY_NAMES,
IN_CFG_ABS_DEAD_ZONE, /* dead zone for analog-digital mapping */
IN_CFG_ABS_AXIS_COUNT, /* number of abs axes (ro) */
+ IN_CFG_DEFAULT_DEV,
};
enum {