Struct rebind::InputRebind
[−]
[src]
pub struct InputRebind<A: Action, S: BuildHasher = RandomState> { /* fields omitted */ }
An interface for rebinding keys to actions. This is freely convertable to and from an InputTranslator.
Methods
impl<A: Action, S: BuildHasher + Default> InputRebind<A, S>
[src]
fn new<Sz: Into<Size>>(size: Sz) -> 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.
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, S>
Convert the InputRebind
into an InputTranslator
. Consumes the
InputRebind
.
Trait Implementations
impl<A: Clone + Action, S: Clone + BuildHasher> Clone for InputRebind<A, S>
[src]
fn clone(&self) -> InputRebind<A, S>
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: Debug + Action, S: Debug + BuildHasher> Debug for InputRebind<A, S>
[src]
impl<A: PartialEq + Action, S: PartialEq + BuildHasher> PartialEq for InputRebind<A, S>
[src]
fn eq(&self, __arg_0: &InputRebind<A, S>) -> 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, S>) -> bool
This method tests for !=
.
impl<A: Action, S: BuildHasher + Default> Into<InputTranslator<A, S>> for InputRebind<A, S>
[src]
fn into(self) -> InputTranslator<A, S>
Performs the conversion.