aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMarvin Borner2020-08-24 12:21:23 +0200
committerMarvin Borner2020-08-24 12:21:23 +0200
commit0a4c8dd2d6048fe9851b8d92a311bba7aaa83a57 (patch)
tree5e1e235f4ff22b3233f43db768ddd373f6063856 /apps
parent0e05b395cb8868b77d91d9d614ff5ae09b3b853a (diff)
Removed async events
Diffstat (limited to 'apps')
-rw-r--r--apps/wm.c15
1 files changed, 4 insertions, 11 deletions
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);
}