Escape key exits program.
This commit is contained in:
parent
14e15b08a1
commit
e1c81d2c1c
|
|
@ -39,11 +39,15 @@ draw_char(u8 ch, u64 dest_x, u64 dest_y)
|
|||
}
|
||||
|
||||
|
||||
//void
|
||||
//keydown(u64 window_id, u16 keycode)
|
||||
//{
|
||||
// window_draw_frame(window_id, frame_buffer);
|
||||
//}
|
||||
void
|
||||
keydown(u64 window_id, u16 keycode)
|
||||
{
|
||||
if (KEY_BACKSPACE == keycode) {
|
||||
exit(0);
|
||||
}
|
||||
print_i64(keycode);
|
||||
print_endl();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
|
@ -78,7 +82,7 @@ main()
|
|||
);
|
||||
}
|
||||
window_draw_frame(wid, frame_buffer);
|
||||
//window_on_keydown(wid, keydown);
|
||||
window_on_keydown(wid, keydown);
|
||||
window_on_mousedown(wid, mousedown);
|
||||
window_on_mousemove(wid, mousemove);
|
||||
enable_event_loop();
|
||||
|
|
|
|||
Loading…
Reference in New Issue