[][src]Struct bracket_lib::prelude::Input

pub struct Input { /* fields omitted */ }

Represents the current input state. The old key/mouse fields remain available for compatibility.

Methods

impl Input[src]

pub fn is_key_pressed(&self, key: VirtualKeyCode) -> bool[src]

Checks to see if a key is pressed. True if it is, false otherwise.

pub fn is_scancode_pressed(&self, scan_code: u32) -> bool[src]

Checks to see if a key is pressed by scancode. True if it is, false if it isn't.

pub fn is_mouse_button_pressed(&self, button_num: usize) -> bool[src]

Checks to see if a mouse button is pressed. 0 = left, 1 = right, 2 = middle, etc. is the convention for button numbering.

pub fn mouse_button_pressed_set(&self) -> &HashSet<usize, RandomState>[src]

HashSet of pressed mouse buttons

pub fn scan_code_pressed_set(&self) -> &HashSet<u32, RandomState>[src]

HashSet of pressed keyboard scan codes

pub fn key_pressed_set(&self) -> &HashSet<VirtualKeyCode, RandomState>[src]

HashSet of pressed keyboard scan codes

pub fn mouse_tile_pos(&self, console: usize) -> (i32, i32)[src]

Returns the current mouse position (0,0 if there isn't one yet), in TILE coordinates for the specified console layer.

pub fn mouse_tile(&self, console: usize) -> Point[src]

Returns the current mouse position (0,0 if there isn't one yet), in TILE coordinates for the specified console layer in Point format.

pub fn mouse_pixel_pos(&self) -> (f64, f64)[src]

Return the current mouse position in pixels.

pub fn activate_event_queue(&mut self)[src]

Call this to enable the event queue. Otherwise, events will not be tracked/stored outside of the HAL setup (to avoid continually filling a buffer that isn't being used).

pub fn pop(&mut self) -> Option<BEvent>[src]

Pop a single event from the event queue. Returns None if there aren't any events.

pub fn for_each_message<F>(&mut self, action: F) where
    F: FnMut(BEvent), 
[src]

Provides a for_each function for all messages in the queue.

pub fn get_scale_factor(&self) -> f64[src]

Gets the current scale factor

Trait Implementations

impl Clone for Input[src]

impl Debug for Input[src]

Auto Trait Implementations

impl RefUnwindSafe for Input

impl Send for Input

impl Sync for Input

impl Unpin for Input

impl UnwindSafe for Input

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,