aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMarvin Borner2021-01-21 17:04:15 +0100
committerMarvin Borner2021-01-21 17:04:15 +0100
commitb3fafef621bb4404208e65ff1f78e15da3b216f7 (patch)
tree6f1c610b816f574c77615cb03d5507a4281411dd /apps
parentef407d1e965674c5278daeb25a72acf446ec3223 (diff)
Implementing new features...
Diffstat (limited to 'apps')
-rw-r--r--apps/wm.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/wm.c b/apps/wm.c
index 469e824..9b7631d 100644
--- a/apps/wm.c
+++ b/apps/wm.c
@@ -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;
}