diff options
author | Marvin Borner | 2021-01-21 17:04:15 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-21 17:04:15 +0100 |
commit | b3fafef621bb4404208e65ff1f78e15da3b216f7 (patch) | |
tree | 6f1c610b816f574c77615cb03d5507a4281411dd /apps | |
parent | ef407d1e965674c5278daeb25a72acf446ec3223 (diff) |
Implementing new features...
Diffstat (limited to 'apps')
-rw-r--r-- | apps/wm.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -285,11 +285,22 @@ int main(int argc, char **argv) gfx_load_image(&cursor, "/res/cursor.png", 0, 0); redraw_all(); - /* event_register(EVENT_MOUSE); */ - /* event_register(EVENT_KEYBOARD); */ - struct message msg = { 0 }; + struct event_keyboard kbd_event = { 0 }; + struct event_mouse mouse_event = { 0 }; while (1) { + if (read("/dev/kbd", &kbd_event, 0, sizeof(struct event_keyboard))) + handle_keyboard(&kbd_event); + /* else if (read("/dev/mouse", &mouse_event, 0, sizeof(struct event_mouse))) */ + /* handle_mouse(&mouse_event); */ + /* else if (msg_receive(&msg)) { */ + /* handle_message(&msg); */ + /* } */ + else { + yield(); + continue; + } + //if (!msg_receive(&msg)) { yield(); continue; @@ -323,12 +334,6 @@ int main(int argc, char **argv) case GFX_REDRAW_FOCUSED: redraw_focused(); break; - case EVENT_MOUSE: - handle_mouse(msg.data); - break; - case EVENT_KEYBOARD: - handle_keyboard(msg.data); - break; default: break; } |