pub struct InputMapping {Show 29 fields
pub keyboard_navigation: bool,
pub gamepads: Vec<Gamepad>,
pub joystick_ui_deadzone: f32,
pub move_x: GamepadAxisType,
pub move_y: GamepadAxisType,
pub left_button: GamepadButtonType,
pub right_button: GamepadButtonType,
pub up_button: GamepadButtonType,
pub down_button: GamepadButtonType,
pub action_button: GamepadButtonType,
pub cancel_button: GamepadButtonType,
pub previous_button: GamepadButtonType,
pub next_button: GamepadButtonType,
pub free_button: GamepadButtonType,
pub key_left: KeyCode,
pub key_right: KeyCode,
pub key_up: KeyCode,
pub key_down: KeyCode,
pub key_left_alt: KeyCode,
pub key_right_alt: KeyCode,
pub key_up_alt: KeyCode,
pub key_down_alt: KeyCode,
pub key_action: KeyCode,
pub key_cancel: KeyCode,
pub key_next: KeyCode,
pub key_next_alt: KeyCode,
pub key_previous: KeyCode,
pub key_free: KeyCode,
pub focus_follows_mouse: bool,
}
Expand description
Control default ui navigation input buttons
Fields§
Whether to use keybaord keys for navigation (instead of just actions).
gamepads: Vec<Gamepad>
The gamepads to use for the UI. If empty, default to gamepad 0
joystick_ui_deadzone: f32
Deadzone on the gamepad left stick for ui navigation
move_x: GamepadAxisType
X axis of gamepad stick
move_y: GamepadAxisType
Y axis of gamepad stick
Gamepad button for Direction::West
NavRequest::Move
Gamepad button for Direction::East
NavRequest::Move
Gamepad button for Direction::North
NavRequest::Move
Gamepad button for Direction::South
NavRequest::Move
Gamepad button for NavRequest::Action
Gamepad button for NavRequest::Cancel
Gamepad button for ScopeDirection::Previous
NavRequest::ScopeMove
Gamepad button for ScopeDirection::Next
NavRequest::ScopeMove
Gamepad button for NavRequest::Unlock
key_left: KeyCode
Keyboard key for Direction::West
NavRequest::Move
key_right: KeyCode
Keyboard key for Direction::East
NavRequest::Move
key_up: KeyCode
Keyboard key for Direction::North
NavRequest::Move
key_down: KeyCode
Keyboard key for Direction::South
NavRequest::Move
key_left_alt: KeyCode
Alternative keyboard key for Direction::West
NavRequest::Move
key_right_alt: KeyCode
Alternative keyboard key for Direction::East
NavRequest::Move
key_up_alt: KeyCode
Alternative keyboard key for Direction::North
NavRequest::Move
key_down_alt: KeyCode
Alternative keyboard key for Direction::South
NavRequest::Move
key_action: KeyCode
Keyboard key for NavRequest::Action
key_cancel: KeyCode
Keyboard key for NavRequest::Cancel
key_next: KeyCode
Keyboard key for ScopeDirection::Next
NavRequest::ScopeMove
key_next_alt: KeyCode
Alternative keyboard key for ScopeDirection::Next
NavRequest::ScopeMove
key_previous: KeyCode
Keyboard key for ScopeDirection::Previous
NavRequest::ScopeMove
key_free: KeyCode
Keyboard key for NavRequest::Unlock
focus_follows_mouse: bool
Whether mouse hover gives focus to Focusable
elements.
Trait Implementations§
Source§impl Default for InputMapping
impl Default for InputMapping
Source§impl FromReflect for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl FromReflect for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
Source§fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
Self
from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn Reflect>,
) -> Result<Self, Box<dyn Reflect>>
fn take_from_reflect( reflect: Box<dyn Reflect>, ) -> Result<Self, Box<dyn Reflect>>
Self
using,
constructing the value using from_reflect
if that fails. Read moreSource§impl GetTypeRegistration for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl GetTypeRegistration for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
Source§impl Reflect for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl Reflect for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any
.Source§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Reflect
trait object. Read moreSource§fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Source§fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
Source§fn type_name(&self) -> &str
fn type_name(&self) -> &str
Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl Struct for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl Struct for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
Source§fn field(&self, name: &str) -> Option<&dyn Reflect>
fn field(&self, name: &str) -> Option<&dyn Reflect>
name
as a &dyn Reflect
.Source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
name
as a
&mut dyn Reflect
.Source§fn field_at(&self, index: usize) -> Option<&dyn Reflect>
fn field_at(&self, index: usize) -> Option<&dyn Reflect>
index
as a
&dyn Reflect
.Source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
index
as a &mut dyn Reflect
.Source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index
.Source§fn iter_fields(&self) -> FieldIter<'_>
fn iter_fields(&self) -> FieldIter<'_>
Source§fn clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct
.Source§impl TypePath for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl TypePath for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl Typed for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl Typed for InputMappingwhere
bool: FromReflect + TypePath,
Vec<Gamepad>: FromReflect + TypePath,
f32: FromReflect + TypePath,
GamepadAxisType: FromReflect + TypePath,
GamepadButtonType: FromReflect + TypePath,
KeyCode: FromReflect + TypePath,
impl Resource for InputMapping
Auto Trait Implementations§
impl Freeze for InputMapping
impl RefUnwindSafe for InputMapping
impl Send for InputMapping
impl Sync for InputMapping
impl Unpin for InputMapping
impl UnwindSafe for InputMapping
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read more