mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
in_evdev: revert multi event handling from r901 to avoid unwanted blocking
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@910 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
143e9a87da
commit
afc00cad1f
1 changed files with 50 additions and 51 deletions
|
@ -402,8 +402,8 @@ static int in_evdev_update_keycode(void *data, int *is_down)
|
||||||
struct input_event ev;
|
struct input_event ev;
|
||||||
int rd;
|
int rd;
|
||||||
|
|
||||||
while (1)
|
/* do single event, the caller sometimes wants
|
||||||
{
|
* to do select() in blocking mode */
|
||||||
rd = read(dev->fd, &ev, sizeof(ev));
|
rd = read(dev->fd, &ev, sizeof(ev));
|
||||||
if (rd < (int) sizeof(ev)) {
|
if (rd < (int) sizeof(ev)) {
|
||||||
if (errno != EAGAIN) {
|
if (errno != EAGAIN) {
|
||||||
|
@ -415,7 +415,7 @@ static int in_evdev_update_keycode(void *data, int *is_down)
|
||||||
|
|
||||||
if (ev.type == EV_KEY) {
|
if (ev.type == EV_KEY) {
|
||||||
if (ev.value < 0 || ev.value > 1)
|
if (ev.value < 0 || ev.value > 1)
|
||||||
continue;
|
goto out;
|
||||||
ret_kc = ev.code;
|
ret_kc = ev.code;
|
||||||
ret_down = ev.value;
|
ret_down = ev.value;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -440,10 +440,10 @@ static int in_evdev_update_keycode(void *data, int *is_down)
|
||||||
last = &dev->abs_lasty;
|
last = &dev->abs_lasty;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
continue;
|
goto out;
|
||||||
|
|
||||||
if (down == *last)
|
if (down == *last)
|
||||||
continue;
|
goto out;
|
||||||
|
|
||||||
if (down == 0 || *last != 0) {
|
if (down == 0 || *last != 0) {
|
||||||
/* key up or direction change, return up event for old key */
|
/* key up or direction change, return up event for old key */
|
||||||
|
@ -456,7 +456,6 @@ static int in_evdev_update_keycode(void *data, int *is_down)
|
||||||
ret_down = 1;
|
ret_down = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (is_down != NULL)
|
if (is_down != NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue