WindowEventHandler

Trait WindowEventHandler 

Source
pub trait WindowEventHandler: Send + Sync {
    // Required methods
    fn update(&self, _window: &mut Window) -> Result<()>;
    fn draw(&mut self, _window: &mut Window) -> Result<()>;

    // Provided methods
    fn key_down_event(
        &self,
        _window: &mut Window,
        _event: KeyboardEvent,
    ) -> Result<()> { ... }
    fn key_up_event(
        &self,
        _window: &mut Window,
        _event: KeyboardEvent,
    ) -> Result<()> { ... }
    fn mouse_motion_event(
        &self,
        _window: &mut Window,
        _event: MouseMotionEvent,
    ) -> Result<()> { ... }
    fn mouse_button_down_event(
        &self,
        _window: &mut Window,
        _event: MouseClickEvent,
    ) -> Result<()> { ... }
    fn mouse_button_up_event(
        &self,
        _window: &mut Window,
        _event: MouseClickEvent,
    ) -> Result<()> { ... }
    fn mouse_wheel_event(
        &self,
        _window: &mut Window,
        _event: MouseWheelEvent,
    ) -> Result<()> { ... }
}

Required Methods§

Source

fn update(&self, _window: &mut Window) -> Result<()>

Source

fn draw(&mut self, _window: &mut Window) -> Result<()>

Provided Methods§

Source

fn key_down_event( &self, _window: &mut Window, _event: KeyboardEvent, ) -> Result<()>

Source

fn key_up_event( &self, _window: &mut Window, _event: KeyboardEvent, ) -> Result<()>

Source

fn mouse_motion_event( &self, _window: &mut Window, _event: MouseMotionEvent, ) -> Result<()>

Source

fn mouse_button_down_event( &self, _window: &mut Window, _event: MouseClickEvent, ) -> Result<()>

Source

fn mouse_button_up_event( &self, _window: &mut Window, _event: MouseClickEvent, ) -> Result<()>

Source

fn mouse_wheel_event( &self, _window: &mut Window, _event: MouseWheelEvent, ) -> Result<()>

Implementors§