mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
input: move default bind handling to input core
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@953 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
a70e251871
commit
9eab224e09
3 changed files with 5 additions and 20 deletions
|
@ -586,18 +586,6 @@ static int in_evdev_menu_translate(void *drv_data, int keycode)
|
||||||
return 0;
|
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 */
|
/* remove binds of missing keys, count remaining ones */
|
||||||
static int in_evdev_clean_binds(void *drv_data, int *binds, int *def_binds)
|
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,
|
.probe = in_evdev_probe,
|
||||||
.free = in_evdev_free,
|
.free = in_evdev_free,
|
||||||
.get_key_names = in_evdev_get_key_names,
|
.get_key_names = in_evdev_get_key_names,
|
||||||
.get_def_binds = in_evdev_get_def_binds,
|
|
||||||
.clean_binds = in_evdev_clean_binds,
|
.clean_binds = in_evdev_clean_binds,
|
||||||
.get_config = in_evdev_get_config,
|
.get_config = in_evdev_get_config,
|
||||||
.set_config = in_evdev_set_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,
|
.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
|
struct in_default_bind;
|
||||||
extern int in_evdev_allow_abs_only;
|
extern int in_evdev_allow_abs_only;
|
||||||
|
|
||||||
void in_evdev_init(void);
|
void in_evdev_init(const struct in_default_bind *defbinds);
|
||||||
|
|
||||||
/* to be set somewhere in platform code */
|
|
||||||
extern struct in_default_bind in_evdev_defbinds[];
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* See the COPYING file in the top-level directory.
|
* See the COPYING file in the top-level directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE 1
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue