aboutsummaryrefslogtreecommitdiff
path: root/src/sysbin
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
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')
-rw-r--r--src/sysbin/giosrv/main.c17
-rw-r--r--src/sysbin/login/main.c10
2 files changed, 22 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) {
diff --git a/src/sysbin/login/main.c b/src/sysbin/login/main.c
index 294ad76..e6e5290 100644
--- a/src/sysbin/login/main.c
+++ b/src/sysbin/login/main.c
@@ -15,6 +15,8 @@ typedef struct {
} loginc_t;
void c_buffer_info(gip_handler_t *s, gip_msg_header *p, gip_buffer_info_msg *m);
+void c_key_down(gip_handler_t *s, gip_msg_header *p);
+void c_key_up(gip_handler_t *s, gip_msg_header *p);
void c_unknown_msg(gip_handler_t *s, gip_msg_header *p);
void c_fd_error(gip_handler_t *s);
@@ -32,6 +34,8 @@ gip_handler_callbacks_t loginc_cb = {
.buffer_info = c_buffer_info,
.mode_info = 0,
.buffer_damage = 0,
+ .key_down = c_key_down,
+ .key_up = c_key_up,
.unknown_msg = c_unknown_msg,
.fd_error = c_fd_error,
};
@@ -98,6 +102,12 @@ void c_buffer_info(gip_handler_t *s, gip_msg_header *p, gip_buffer_info_msg *m)
}
}
+void c_key_down(gip_handler_t *s, gip_msg_header *p) {
+}
+
+void c_key_up(gip_handler_t *s, gip_msg_header *p) {
+}
+
void c_unknown_msg(gip_handler_t *s, gip_msg_header *p) {
// TODO
}