feat: Buttons + events
wip: malloc feat: Buttons
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user