aboutsummaryrefslogtreecommitdiff
path: root/frontend/linux
diff options
context:
space:
mode:
authornotaz2012-04-24 01:48:17 +0300
committernotaz2012-04-29 19:32:08 +0300
commitb07c18e8645a17be916266820ae564e0d320cc1a (patch)
treee5a2dfa3128b1294f86ed010258ede0c37e56bd0 /frontend/linux
parent7badc9353b9570fd1c67827cfb477cef07974ddb (diff)
downloadpcsx_rearmed-b07c18e8645a17be916266820ae564e0d320cc1a.tar.gz
pcsx_rearmed-b07c18e8645a17be916266820ae564e0d320cc1a.tar.bz2
pcsx_rearmed-b07c18e8645a17be916266820ae564e0d320cc1a.zip
frontend: input: pass default binds as argument
allows to get rid of some hacks
Diffstat (limited to 'frontend/linux')
-rw-r--r--frontend/linux/in_evdev.c17
-rw-r--r--frontend/linux/in_evdev.h6
2 files changed, 4 insertions, 19 deletions
diff --git a/frontend/linux/in_evdev.c b/frontend/linux/in_evdev.c
index 23d2e2a..c615061 100644
--- a/frontend/linux/in_evdev.c
+++ b/frontend/linux/in_evdev.c
@@ -586,18 +586,6 @@ static int in_evdev_menu_translate(void *drv_data, int keycode)
return 0;
}
-static void in_evdev_get_def_binds(int *binds)
-{
- int i;
-
- for (i = 0; ; i++) {
- if (in_evdev_defbinds[i].bit == 0 && in_evdev_defbinds[i].code == 0)
- break;
- 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 */
static int in_evdev_clean_binds(void *drv_data, int *binds, int *def_binds)
{
@@ -637,7 +625,6 @@ static const in_drv_t in_evdev_drv = {
.probe = in_evdev_probe,
.free = in_evdev_free,
.get_key_names = in_evdev_get_key_names,
- .get_def_binds = in_evdev_get_def_binds,
.clean_binds = in_evdev_clean_binds,
.get_config = in_evdev_get_config,
.set_config = in_evdev_set_config,
@@ -647,8 +634,8 @@ static const in_drv_t in_evdev_drv = {
.menu_translate = in_evdev_menu_translate,
};
-void in_evdev_init(void)
+void in_evdev_init(const struct in_default_bind *defbinds)
{
- in_register_driver(&in_evdev_drv);
+ in_register_driver(&in_evdev_drv, defbinds);
}
diff --git a/frontend/linux/in_evdev.h b/frontend/linux/in_evdev.h
index 6141b2b..c5aef9b 100644
--- a/frontend/linux/in_evdev.h
+++ b/frontend/linux/in_evdev.h
@@ -1,7 +1,5 @@
+struct in_default_bind;
extern int in_evdev_allow_abs_only;
-void in_evdev_init(void);
-
-/* to be set somewhere in platform code */
-extern struct in_default_bind in_evdev_defbinds[];
+void in_evdev_init(const struct in_default_bind *defbinds);