Struct tiny_game_framework::EventHandler
source · pub struct EventHandler {
pub keys_pressed: HashMap<Key, usize>,
pub mouse_pos: Vector2D,
pub width: f32,
pub height: f32,
pub lmb: bool,
pub rmb: bool,
}
Fields§
§keys_pressed: HashMap<Key, usize>
§mouse_pos: Vector2D
§width: f32
§height: f32
§lmb: bool
§rmb: bool
Implementations§
source§impl EventHandler
impl EventHandler
pub fn new() -> Self
pub fn on_key_press(&mut self, key: Key)
pub fn on_key_release(&mut self, key: Key)
pub fn on_mouse_move(&mut self, x: f64, y: f64)
pub fn on_lmb_press(&mut self)
pub fn on_lmb_release(&mut self)
pub fn on_rmb_press(&mut self)
pub fn on_rmb_release(&mut self)
pub fn on_window_resize(&mut self, w: i32, h: i32)
Auto Trait Implementations§
impl Freeze for EventHandler
impl RefUnwindSafe for EventHandler
impl Send for EventHandler
impl Sync for EventHandler
impl Unpin for EventHandler
impl UnwindSafe for EventHandler
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more