diff options
-rw-r--r-- | src/surface/kolibri.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/surface/kolibri.c b/src/surface/kolibri.c index 6a7b2dc..d1b5d4c 100644 --- a/src/surface/kolibri.c +++ b/src/surface/kolibri.c @@ -53,13 +53,6 @@ int kolibri_get_button_id(void) } } -int kolibri_wait_for_event(void) -{ - uint32_t __ret; - __asm__ __volatile__ ("int $0x40":"=a"(__ret):"0"(10)); - return __ret; -} - int kolibri_get_pressed_key(void) { uint16_t __ret; @@ -243,8 +236,7 @@ static int kolibri_surface_initialise(nsfb_t *nsfb) EVENT_BUTTON | EVENT_MOUSE_CHANGE | EVENT_INACTIVE_NO_CURSOR | - EVENT_INACTIVE_NO_MOUSE | - EVENT_NETWORK); + EVENT_INACTIVE_NO_MOUSE); return 0; } @@ -364,19 +356,19 @@ int ispowerkey(int scancode) } static bool kolibri_surface_input(nsfb_t *nsfb, nsfb_event_t *event, - int timeout) + int timeout) { int got_event; static int scanfull = 0; char event_num[20]; + nsfb = nsfb; /* unused */ + /* schedule_run from gui.c might have returned negative for wait forever. This stalls us completely for network etc. + Don't do that. Always try to yield back to scheduler asap */ - if (timeout >= 0) { - got_event = kolibri_wait_for_event_with_timeout(timeout / 10); - } else { - got_event = kolibri_wait_for_event(); - } + if(timeout < 0) timeout = 100; /* millis */ + got_event = kolibri_wait_for_event_with_timeout(timeout / 10); if (got_event == 0) { return false; @@ -439,7 +431,7 @@ static bool kolibri_surface_input(nsfb_t *nsfb, nsfb_event_t *event, unsigned diff = previous_mouse_buttons^b; /* All high bits in the XOR represent bits that changed */ - if (diff & 0x1) { + if (diff & 0x1 || diff & 0x10000) { /* Left mouse button */ event->value.keycode = NSFB_KEY_MOUSE_1; /* debug_board_printf("-- Mouse LEFT button : 0x%x\n", b); */ |