Struct conrod::input::state::State [] [src]

pub struct State {
    pub mouse: Mouse,
    pub widget_capturing_keyboard: Option<Index>,
    pub widget_capturing_mouse: Option<Index>,
    pub widget_under_mouse: Option<Index>,
    pub modifiers: ModifierKey,
}

Holds the current state of user input.

This includes the state of all buttons on the keyboard and mouse, as well as the position of the mouse.

It also includes which widgets, if any, are capturing keyboard and mouse input.

Fields

mouse: Mouse

Mouse position and button state.

widget_capturing_keyboard: Option<Index>

Which widget, if any, is currently capturing the keyboard

widget_capturing_mouse: Option<Index>

Which widget, if any, is currently capturing the mouse

widget_under_mouse: Option<Index>

The widget that is currently under the mouse cursor.

If the mouse is currently over multiple widgets, this index will represent the top-most, non-graphic-child widget.

modifiers: ModifierKey

Which modifier keys are being held down.

Methods

impl State
[src]

fn new() -> State

Returns a fresh new input state

fn relative_to(self, xy: Point) -> State

Returns a copy of the input::State relative to the given position::Point

Trait Implementations

impl PartialEq for State
[src]

fn eq(&self, __arg_0: &State) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &State) -> bool

This method tests for !=.

impl Debug for State
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for State
[src]

fn clone(&self) -> State

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for State
[src]