pub enum KeyboardIgnoreModifiers {
None,
AbcKeyCode,
}Expand description
Settings for whether to ignore modifiers and use standard keyboard layouts instead.
This does not affect piston::input::TextEvent.
Piston uses the same key codes as in SDL2. The problem is that without knowing the keyboard layout, there is no coherent way of generating key codes.
This option choose different tradeoffs depending on need.
Variants§
None
Keep the key codes that are affected by modifiers.
This is a good default for most applications. However, make sure to display understandable information to the user.
If you experience user problems among gamers, then you might consider allowing other options in your game engine. Some gamers might be used to how stuff works in other traditional game engines and struggle understanding this configuration, depending on how you use keyboard layout.
AbcKeyCode
Assume the user’s keyboard layout is standard English ABC.
In some non-English speaking countries, this might be more user friendly for some gamers.
This might sound counter-intuitive at first, so here is the reason:
Gamers can customize their keyboard layout without needing to understand scan codes. When gamers want physically accuracy with good default options, they can simply use standard English ABC.
In other cases, this option displays understandable information for game instructions. This information makes it easier for users to correct the problem themselves.
Most gaming consoles use standard controllers. Typically, the only device that might be problematic for users is the keyboard. Instead of solving this problem in your game engine, let users do it in the OS.
This option gives more control to users and is also better for user data privacy. Detecting keyboard layout is usually not needed. Instead, provide options for the user where they can modify the keys. If users want to switch layout in the middle of a game, they can do it through the OS.
Trait Implementations§
Source§impl Clone for KeyboardIgnoreModifiers
impl Clone for KeyboardIgnoreModifiers
Source§fn clone(&self) -> KeyboardIgnoreModifiers
fn clone(&self) -> KeyboardIgnoreModifiers
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyboardIgnoreModifiers
impl Debug for KeyboardIgnoreModifiers
Source§impl PartialEq for KeyboardIgnoreModifiers
impl PartialEq for KeyboardIgnoreModifiers
impl Copy for KeyboardIgnoreModifiers
impl Eq for KeyboardIgnoreModifiers
impl StructuralPartialEq for KeyboardIgnoreModifiers
Auto Trait Implementations§
impl Freeze for KeyboardIgnoreModifiers
impl RefUnwindSafe for KeyboardIgnoreModifiers
impl Send for KeyboardIgnoreModifiers
impl Sync for KeyboardIgnoreModifiers
impl Unpin for KeyboardIgnoreModifiers
impl UnwindSafe for KeyboardIgnoreModifiers
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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.