From 0a4c8dd2d6048fe9851b8d92a311bba7aaa83a57 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 24 Aug 2020 12:21:23 +0200 Subject: Removed async events --- apps/wm.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'apps') diff --git a/apps/wm.c b/apps/wm.c index 5e5fd01..45fbff0 100644 --- a/apps/wm.c +++ b/apps/wm.c @@ -16,15 +16,6 @@ struct window *root; // Root window (wallpaper etc.) struct window *exchange; // Exchange buffer struct list *windows; -void onkey(u32 scancode) -{ - printf("WM KEY EVENT %d\n", scancode); - if (KEY_ALPHANUMERIC(scancode)) { - printf("ALPHANUMERIC!\n"); - } - event_resolve(); -} - static struct window *new_window(int x, int y, u16 width, u16 height) { struct window *win = malloc(sizeof(*win)); @@ -61,8 +52,7 @@ int main(int argc, char **argv) // TODO: Fix wallpaper /* gui_load_wallpaper(root, "/wall.bmp"); */ - // TODO: Remove async events completely - /* event_map(EVENT_KEYBOARD, onkey); */ + event_register(EVENT_KEYBOARD); struct message *msg; while (1) { @@ -87,6 +77,9 @@ int main(int argc, char **argv) msg_send(msg->src, MSG_NEW_WINDOW, win); list_add(windows, win); break; + case EVENT_KEYBOARD: + printf("Keypress %d!\n", msg->data); + break; default: printf("Unknown WM request %d from pid %d", msg->type, msg->src); } -- cgit v1.2.3