mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 06:47:45 -04:00
in_evdev: revert multi event handling from r901 to avoid unwanted blocking
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@910 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
b7c7cd5d46
commit
e30684582a
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;
|
||||
int rd;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* do single event, the caller sometimes wants
|
||||
* to do select() in blocking mode */
|
||||
rd = read(dev->fd, &ev, sizeof(ev));
|
||||
if (rd < (int) sizeof(ev)) {
|
||||
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.value < 0 || ev.value > 1)
|
||||
continue;
|
||||
goto out;
|
||||
ret_kc = ev.code;
|
||||
ret_down = ev.value;
|
||||
goto out;
|
||||
|
@ -440,10 +440,10 @@ static int in_evdev_update_keycode(void *data, int *is_down)
|
|||
last = &dev->abs_lasty;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
goto out;
|
||||
|
||||
if (down == *last)
|
||||
continue;
|
||||
goto out;
|
||||
|
||||
if (down == 0 || *last != 0) {
|
||||
/* 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;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
if (is_down != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue