notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
input: detect dead devices, always set keynames
[picodrive.git]
/
platform
/
linux
/
in_evdev.c
diff --git
a/platform/linux/in_evdev.c
b/platform/linux/in_evdev.c
index
a51fe2d
..
d863c02
100644
(file)
--- a/
platform/linux/in_evdev.c
+++ b/
platform/linux/in_evdev.c
@@
-570,7
+570,9
@@
static void in_evdev_get_def_binds(int *binds)
{
int i;
{
int i;
- for (i = 0; in_evdev_defbinds[i].bit != 0; 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;
}
binds[IN_BIND_OFFS(in_evdev_defbinds[i].code, in_evdev_defbinds[i].btype)] =
1 << in_evdev_defbinds[i].bit;
}
@@
-583,10
+585,11
@@
static int in_evdev_clean_binds(void *drv_data, int *binds, int *def_binds)
in_evdev_t *dev = drv_data;
int i, t, ret, offs, count = 0;
in_evdev_t *dev = drv_data;
int i, t, ret, offs, count = 0;
+ memset(keybits, 0, sizeof(keybits));
ret = ioctl(dev->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
if (ret == -1) {
perror("in_evdev: ioctl failed");
ret = ioctl(dev->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
if (ret == -1) {
perror("in_evdev: ioctl failed");
- memset(keybits, 0xff, sizeof(keybits)); /* mark all as good */
+
//
memset(keybits, 0xff, sizeof(keybits)); /* mark all as good */
}
if (dev->abs_lzone != 0) {
}
if (dev->abs_lzone != 0) {