Struct rebind::InputRebind [] [src]

pub struct InputRebind<A: Action> {
    // some fields omitted
}

An interface for rebinding keys to actions. This is freely convertable to and from an InputTranslator.

Methods

impl<A: Action> InputRebind<A>
[src]

fn new<S: Into<Size>>(size: S) -> Self

Creates a new InputRebind with no stored Action/ButtonTuple pairs.

fn insert_action(&mut self, action: A) -> Option<ButtonTuple>

Insert an Action into this InputRebind. If the Action is already in the InputRebind, then its ButtonTuple will be reset to (None, None, None), and the old ButtonTuple will be returned.

fn insert_action_with_buttons(&mut self, action: A, buttons: ButtonTuple) -> Option<ButtonTuple>

Insert an Action into this InputRebind, and assign it to the ButtonTuple. If the Action is already in the InputRebind, the old ButtonTuple will be returned.

fn get_bindings(&self, action: &A) -> Option<&ButtonTuple>

Return a reference to the current ButtonTuple stored for an action. If the action is not stored in this InputRebind, then None will be returned.

fn get_bindings_mut(&mut self, action: &mut A) -> Option<&mut ButtonTuple>

Returns a mutable reference to the current ButtonTuple stored for an action. If the action is not stored in this InputRebind, then None will be returned.

fn get_x_scroll_inverted(&self) -> bool

Returns whether mouse scroll along the x axis is inverted.

fn set_x_scroll_inverted(&mut self, invert_x_scroll: bool)

Set whether mouse scroll along the x axis is inverted.

fn get_y_scroll_inverted(&self) -> bool

Returns whether mouse scroll along the y axis is inverted.

fn set_y_scroll_inverted(&mut self, invert_y_scroll: bool)

Set whether mouse scroll along the y axis is inverted.

fn get_x_motion_inverted(&self) -> bool

Returns whether mouse motion along the x axis is inverted.

fn set_x_motion_inverted(&mut self, invert_x_motion: bool)

Set whether mouse motion along the x axis is inverted.

fn get_y_motion_inverted(&self) -> bool

Returns whether mouse scroll along the y axis is inverted.

fn set_y_motion_inverted(&mut self, invert_y_motion: bool)

Set whether mouse scroll along the y axis is inverted.

fn get_viewport_size(&self) -> Size

Returns the viewport size used for calculating mouse positions.

fn set_viewport_size(&mut self, viewport_size: Size)

Set the viewport size used for calculating mouse positions.

fn into_translator(self) -> InputTranslator<A>

Convert the InputRebind into an InputTranslator. Consumes the InputRebind.

Trait Implementations

impl<A: PartialEq + Action> PartialEq for InputRebind<A>
[src]

fn eq(&self, __arg_0: &InputRebind<A>) -> bool

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

fn ne(&self, __arg_0: &InputRebind<A>) -> bool

This method tests for !=.

impl<A: Debug + Action> Debug for InputRebind<A>
[src]

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

Formats the value using the given formatter.

impl<A: Clone + Action> Clone for InputRebind<A>
[src]

fn clone(&self) -> InputRebind<A>

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<A: Action> Default for InputRebind<A>
[src]

Creates an InputRebind with no pairs. In addition, the viewport size is set to (800, 600).

fn default() -> Self

Returns the "default value" for a type. Read more

impl<A: Action> Into<InputTranslator<A>> for InputRebind<A>
[src]

fn into(self) -> InputTranslator<A>

Performs the conversion.