pub struct EventBox<'video> { /* private fields */ }
Expand description

It takes the closure of handler to register, and delivers events to your event handlers by polling.

Implementations§

source§

impl<'video> EventBox<'video>

source

pub fn new(_: &'video Video<'_>) -> Self

Constructs an event box from the video system.

source

pub fn handle_quit(&mut self, handler: EventHandler<'video, QuitEvent>)

Registers the handler to handle QuitEvent.

source

pub fn handle_window(&mut self, handler: EventHandler<'video, WindowEvent>)

Registers the handler to handle WindowEvent.

source

pub fn handle_keyboard(&mut self, handler: EventHandler<'video, KeyboardEvent>)

Registers the handler to handle KeyboardEvent.

source

pub fn handle_input(&mut self, handler: EventHandler<'video, TextInputEvent>)

Registers the handler to handle TextInputEvent.

source

pub fn handle_editing( &mut self, handler: EventHandler<'video, TextEditingEvent> )

Registers the handler to handle TextEditingEvent.

source

pub fn handle_mouse(&mut self, handler: EventHandler<'video, MouseEvent>)

Registers the handler to handle MouseEvent.

source

pub fn handle_controller( &mut self, handler: EventHandler<'video, ControllerEvent<'video>> )

Registers the handler to handle ControllerEvent.

source

pub fn handle_joystick( &mut self, handler: EventHandler<'video, JoystickEvent<'video>> )

Registers the handler to handle JoystickEvent.

source

pub fn handle_audio_device( &mut self, handler: EventHandler<'video, AudioDeviceEvent> )

Registers the handler to handle AudioDeviceEvent.

source

pub fn handle_drop(&mut self, handler: EventHandler<'video, DropEvent>)

Registers the handler to handle DropEvent.

source

pub fn handle_gesture(&mut self, handler: EventHandler<'video, GestureEvent>)

Registers the handler to handle GestureEvent.

source

pub fn poll(&self)

Polling the events and triggers the event handlers.

source

pub fn wait_next_event_with(&self, timeout_ms: u32)

Waits until the next event occurs, but unlock with timeout seconds.

Trait Implementations§

source§

impl<'video> Drop for EventBox<'video>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'video> !RefUnwindSafe for EventBox<'video>

§

impl<'video> !Send for EventBox<'video>

§

impl<'video> !Sync for EventBox<'video>

§

impl<'video> Unpin for EventBox<'video>

§

impl<'video> !UnwindSafe for EventBox<'video>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.