diff options
author | 2023-05-22 00:17:28 +0200 | |
---|---|---|
committer | 2023-05-22 00:17:28 +0200 | |
commit | 200d91d042a73c5844bccebbd80b5bee4c8cf577 (patch) | |
tree | 48e77c008de2585e2aac587094df96102cbc12da /src/event.h | |
parent | 76f67e43cbf20122be7e82adecd35a316afcc38d (diff) | |
download | cherry-200d91d042a73c5844bccebbd80b5bee4c8cf577.tar.gz cherry-200d91d042a73c5844bccebbd80b5bee4c8cf577.zip |
Add handlers to mouse and keyboard events
Diffstat (limited to 'src/event.h')
-rw-r--r-- | src/event.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/event.h b/src/event.h index 249bac9..08f95f3 100644 --- a/src/event.h +++ b/src/event.h @@ -12,12 +12,25 @@ enum Events { KEY_PRESSED }; +typedef struct CherryEventMouse { + int x; + int y; +} CherryEventMouse; + +typedef struct CherryEventKey { + XKeyEvent xkey; +} CherryEventKey; + typedef struct CherryEvent { Display *display; Window window; int event_id; - int x, y; - XKeyEvent xkey; -}; + CherryEventKey key; + CherryEventMouse mouse; +} CherryEvent; + +CherryEvent cherry_event_create(Display *, Window, int); +CherryEvent cherry_event_mouse_create(Display *, Window, int, int x, int y); +CherryEvent cherry_event_key_create(int, XKeyEvent); #endif /* __CHERRY_EVENT_H__ */ |