aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin/giosrv/main.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-11 16:22:40 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-11 16:22:40 +0100
commit9b9ef5a2c0ec8e66c7da24c4229d89a90a10e914 (patch)
tree471cb88f003eb58ce84342f2e7ab7effda04ce2d /src/sysbin/giosrv/main.c
parenta7ff74cdf2835625282491242ede57b05ceaa782 (diff)
downloadkogata-9b9ef5a2c0ec8e66c7da24c4229d89a90a10e914.tar.gz
kogata-9b9ef5a2c0ec8e66c7da24c4229d89a90a10e914.zip
Bugfixing in progress. Strange bug: wait_on adds to waiters but later not in waiters.
Diffstat (limited to 'src/sysbin/giosrv/main.c')
-rw-r--r--src/sysbin/giosrv/main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sysbin/giosrv/main.c b/src/sysbin/giosrv/main.c
index c161bd6..6e3378b 100644
--- a/src/sysbin/giosrv/main.c
+++ b/src/sysbin/giosrv/main.c
@@ -39,9 +39,12 @@ gip_handler_callbacks_t giosrv_cb = {
.buffer_damage = 0,
.unknown_msg = unknown_msg,
.fd_error = fd_error,
+ .key_down = 0,
+ .key_up = 0,
};
giosrv_t srv;
+gip_handler_t *gipsrv;
// ---- KBD listener
@@ -80,11 +83,11 @@ int main(int argc, char **argv) {
dbg_printf("[giosrv] Running on FB %dx%d\n", srv.mode.width, srv.mode.height);
// ---- GIP server setup
- gip_handler_t *h = new_gip_handler(&giosrv_cb, &srv);
- ASSERT(h != 0);
+ gipsrv = new_gip_handler(&giosrv_cb, &srv);
+ ASSERT(gipsrv != 0);
- h->mainloop_item.fd = 1;
- mainloop_add_fd(&h->mainloop_item);
+ gipsrv->mainloop_item.fd = 1;
+ mainloop_add_fd(&gipsrv->mainloop_item);
// ---- Enter main loop
mainloop_run();
@@ -153,7 +156,11 @@ void fd_error(gip_handler_t *h) {
}
void kbd_handle_event(mainloop_fd_t *fd) {
- // TODO
+ gip_msg_header m;
+ m.arg = kbd.ev.scancode;
+ m.code = (kbd.ev.type == KBD_EVENT_KEYPRESS ? GIPN_KEY_DOWN : GIPN_KEY_UP);
+
+ gip_notify(gipsrv, &m, 0);
}
void kbd_on_error(mainloop_fd_t *fd) {