[]Struct rltk::Input

pub struct Input { /* fields omitted */ }

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

Methods

impl Input

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

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

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

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

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>

HashSet of pressed mouse buttons

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

HashSet of pressed keyboard scan codes

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

HashSet of pressed keyboard scan codes

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

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

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)

Return the current mouse position in pixels.

pub fn activate_event_queue(&mut self)

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>

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), 

Provides a for_each function for all messages in the queue.

pub fn get_scale_factor(&self) -> f64

Gets the current scale factor

Trait Implementations

impl Clone for Input

impl Debug for Input

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>,