From: notaz Date: Thu, 9 Dec 2010 15:57:23 +0000 (+0000) Subject: in_evdev: remove defbinds (should go to plat code) X-Git-Tag: v1.85~150 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea5da0bae3a676efc642549aa9dba094522e92f3;p=picodrive.git in_evdev: remove defbinds (should go to plat code) git-svn-id: file:///home/notaz/opt/svn/PicoDrive@907 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/platform/linux/in_evdev.c b/platform/linux/in_evdev.c index 065676b7..3fcb5aaf 100644 --- a/platform/linux/in_evdev.c +++ b/platform/linux/in_evdev.c @@ -520,6 +520,8 @@ static int in_evdev_menu_translate(void *drv_data, int keycode) return 0; } +/* FIXME: move to plat */ +#if 0 static const struct { short code; char btype; @@ -553,16 +555,16 @@ static const struct { { BTN_PINKIE, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, { BTN_BASE, IN_BINDTYPE_EMU, PEVB_MENU }, }; - -#define DEF_BIND_COUNT (sizeof(in_evdev_def_binds) / sizeof(in_evdev_def_binds[0])) +#endif static void in_evdev_get_def_binds(int *binds) { int i; - for (i = 0; i < DEF_BIND_COUNT; i++) - binds[IN_BIND_OFFS(in_evdev_def_binds[i].code, in_evdev_def_binds[i].btype)] = - 1 << in_evdev_def_binds[i].bit; + for (i = 0; in_evdev_defbinds[i].bit != 0; i++) { + binds[IN_BIND_OFFS(in_evdev_defbinds[i].code, in_evdev_defbinds[i].btype)] = + 1 << in_evdev_defbinds[i].bit; + } } /* remove binds of missing keys, count remaining ones */ diff --git a/platform/linux/in_evdev.h b/platform/linux/in_evdev.h index 2c24c2e7..49682c35 100644 --- a/platform/linux/in_evdev.h +++ b/platform/linux/in_evdev.h @@ -2,3 +2,5 @@ void in_evdev_init(void *vdrv); int in_evdev_update(void *drv_data, const int *binds, int *result); +/* to be set somewhere in platform code */ +extern struct in_default_bind in_evdev_defbinds[];