1
0
forked from Rust/Core

feat: Buttons + events

wip: malloc

feat: Buttons
This commit is contained in:
2024-01-13 13:51:44 +03:00
parent c6351affe3
commit 59d825577a
14 changed files with 502 additions and 42 deletions

View File

@@ -8,12 +8,24 @@ pub fn exit() -> ! {
pub enum Event {
Redraw,
KeyPress,
BtnPress,
BgRedraw,
Mouse,
IPC,
Network,
Debug,
}
pub fn fetch_event() -> Option<Event> {
match unsafe { sys::wait_event() } {
1 => Some(Event::Redraw),
2 => Some(Event::KeyPress),
3 => Some(Event::BtnPress),
5 => Some(Event::BgRedraw),
6 => Some(Event::Mouse),
7 => Some(Event::IPC),
8 => Some(Event::Network),
9 => Some(Event::Debug),
_ => None,
}
}