feat: Add event filters (#5)

This commit is contained in:
2024-03-11 23:50:22 +03:00
parent 79a286dd6d
commit ca5ca3c3c6
5 changed files with 31 additions and 13 deletions

View File

@@ -94,7 +94,9 @@ fn button_handler(c: &mut usize) {
fn kol_main() {
let mut c = 0;
while let Some(ev) = fetch_event() {
while let Some(ev) =
fetch_event((Event::Redraw as u32) | (Event::KeyPress as u32) | (Event::BtnPress as u32))
{
match ev {
Event::Redraw => draw_window(c),
Event::KeyPress => drop(fetch_key()),