pub fn process_sdl_events(input: &mut Input, ev_pump: &mut EventPump) -> bool {
    for ev in ev_pump.poll_iter() {
        match ev {
            Event::Quit { .. } => return true,
            Event::KeyDown {
                scancode: Some(key),
                ..
            } => input.set(InputMapping::Keyboard(key as i32), true),
            Event::KeyUp {
                scancode: Some(key),
                ..
            } => input.set(InputMapping::Keyboard(key as i32), false),
            Event::MouseButtonDown { mouse_btn, .. } => {
                input.set(InputMapping::Mouse(mouse_btn), true)
            }
            Event::MouseButtonUp { mouse_btn, .. } => {
                input.set(InputMapping::Mouse(mouse_btn), false)
            }
            Event::MouseMotion { x, y, .. } => {
                input.set(InputMapping::MousePos(x, y), false);
            }
            Event::MouseWheel { x: _x, y, .. } => {
                input.set(InputMapping::MouseScroll(y), false);
            }
            _ => {}
        }
    }

    false
}
// TODO: I shouldn't return a bool here
I shouldn't return a bool here
I shouldn ' t return a bool here
pub fn process_sdl_events(input: &mut Input, ev_pump: &mut EventPump) -> bool {
    for ev in ev_pump.poll_iter() {
        match ev {
            Event::Quit { .. } => return true,
            Event::KeyDown {
                scancode: Some(key),
                ..
            } => input.set(InputMapping::Keyboard(key as i32), true),
            Event::KeyUp {
                scancode: Some(key),
                ..
            } => input.set(InputMapping::Keyboard(key as i32), false),
            Event::MouseButtonDown { mouse_btn, .. } => {
                input.set(InputMapping::Mouse(mouse_btn), true)
            }
            Event::MouseButtonUp { mouse_btn, .. } => {
                input.set(InputMapping::Mouse(mouse_btn), false)
            }
            Event::MouseMotion { x, y, .. } => {
                input.set(InputMapping::MousePos(x, y), false);
            }
            Event::MouseWheel { x: _x, y, .. } => {
                input.set(InputMapping::MouseScroll(y), false);
            }
            _ => {}
        }
    }
    false
}
pub fn process_sdl_events ( input : & mut Input , ev_pump : & mut EventPump ) -> bool { for ev in ev_pump . poll_iter ( ) { match ev { Event :: Quit { .. } => return true , Event :: KeyDown { scancode : Some ( key ) , .. } => input . set ( InputMapping :: Keyboard ( key as i32 ) , true ) , Event :: KeyUp { scancode : Some ( key ) , .. } => input . set ( InputMapping :: Keyboard ( key as i32 ) , false ) , Event :: MouseButtonDown { mouse_btn , .. } => { input . set ( InputMapping :: Mouse ( mouse_btn ) , true ) } Event :: MouseButtonUp { mouse_btn , .. } => { input . set ( InputMapping :: Mouse ( mouse_btn ) , false ) } Event :: MouseMotion { x , y , .. } => { input . set ( InputMapping :: MousePos ( x , y ) , false ) ; } Event :: MouseWheel { x : _x , y , .. } => { input . set ( InputMapping :: MouseScroll ( y ) , false ) ; } _ => { } } } false }
TODO: I shouldn't return a bool here
TODO : I shouldn ' t return a bool here
input
&mut Input
ev_pump
&mut EventPump
input
&mut Input
ev_pump
&mut EventPump