pub struct CustomKeyMap { /* private fields */ }Expand description
Custom key mapping manager
Implementations§
Source§impl CustomKeyMap
impl CustomKeyMap
Sourcepub fn add_key(&mut self, key: CustomKey) -> Result<(), KeyParseError>
pub fn add_key(&mut self, key: CustomKey) -> Result<(), KeyParseError>
Add a custom key to the mapping
§Errors
Returns KeyParseError::DuplicateCustomKey if a key with the same name already exists
Sourcepub fn remove_key(&mut self, name: &str) -> Option<CustomKey>
pub fn remove_key(&mut self, name: &str) -> Option<CustomKey>
Remove a custom key by name
Sourcepub fn parse_by_name(&self, name: &str) -> Option<&CustomKey>
pub fn parse_by_name(&self, name: &str) -> Option<&CustomKey>
Parse a custom key by name
Sourcepub fn parse_by_code(
&self,
code: usize,
platform: Platform,
) -> Option<&CustomKey>
pub fn parse_by_code( &self, code: usize, platform: Platform, ) -> Option<&CustomKey>
Parse a custom key by code and platform
Sourcepub fn to_code(&self, key: &CustomKey, platform: Platform) -> Option<usize>
pub fn to_code(&self, key: &CustomKey, platform: Platform) -> Option<usize>
Convert a custom key to a platform-specific code
Sourcepub fn contains_key(&self, name: &str) -> bool
pub fn contains_key(&self, name: &str) -> bool
Check if a custom key with the given name exists
Trait Implementations§
Source§impl Debug for CustomKeyMap
impl Debug for CustomKeyMap
Source§impl Default for CustomKeyMap
impl Default for CustomKeyMap
Source§fn default() -> CustomKeyMap
fn default() -> CustomKeyMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CustomKeyMap
impl RefUnwindSafe for CustomKeyMap
impl Send for CustomKeyMap
impl Sync for CustomKeyMap
impl Unpin for CustomKeyMap
impl UnwindSafe for CustomKeyMap
Blanket Implementations§
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
Mutably borrows from an owned value. Read more