diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-11 19:18:59 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-11 19:18:59 +0100 |
commit | 50b5427a8edbb8d59215334f5a250e7f8d6d7ca7 (patch) | |
tree | 7263505b2a6145256ce1f494108a4ceb853c4de0 /src/sysbin/login | |
parent | 0b76aff59b586d87ee0449bc7deda878f4633515 (diff) | |
download | kogata-50b5427a8edbb8d59215334f5a250e7f8d6d7ca7.tar.gz kogata-50b5427a8edbb8d59215334f5a250e7f8d6d7ca7.zip |
Add keyboard handling code. New font thanks to Muazzam from OSDev!
Diffstat (limited to 'src/sysbin/login')
-rw-r--r-- | src/sysbin/login/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sysbin/login/main.c b/src/sysbin/login/main.c index e6e5290..3c02a4b 100644 --- a/src/sysbin/login/main.c +++ b/src/sysbin/login/main.c @@ -5,6 +5,7 @@ #include <gip.h> #include <draw.h> +#include <keyboard.h> typedef struct { fb_info_t mode; @@ -40,9 +41,13 @@ gip_handler_callbacks_t loginc_cb = { .fd_error = c_fd_error, }; +keyboard_t *kb; + int main(int argc, char **argv) { dbg_print("[login] Starting up.\n"); + kb = init_keyboard(); + loginc_t loginc; memset(&loginc, 0, sizeof(loginc)); @@ -103,9 +108,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) { + keyboard_press(kb, p->arg); } void c_key_up(gip_handler_t *s, gip_msg_header *p) { + key_t k = keyboard_release(kb, p->arg); + if (k.chr) dbg_printf("%c", k.chr); } void c_unknown_msg(gip_handler_t *s, gip_msg_header *p) { |