Struct libdof::DescriptiveKey
source · pub struct DescriptiveKey { /* private fields */ }Expand description
A Key with metadata attached. These are produced by calling Dof::keys().
Implementations§
source§impl DescriptiveKey
impl DescriptiveKey
pub fn new( output: Key, layer: String, row: usize, col: usize, finger: Finger ) -> Self
sourcepub fn keypos(&self) -> KeyPos
pub fn keypos(&self) -> KeyPos
Get the KeyPos of a certain key, containing the layer name as well
its row and column coordinates.
sourcepub fn layer_name(&self) -> &str
pub fn layer_name(&self) -> &str
Get the name of the layer of the key.
sourcepub fn is_on_finger(&self, finger: Finger) -> bool
pub fn is_on_finger(&self, finger: Finger) -> bool
Check if the key is on a certain finger.
sourcepub fn is_on_fingers(&self, fingers: &[Finger]) -> bool
pub fn is_on_fingers(&self, fingers: &[Finger]) -> bool
Check if the key is on any of the provided fingers.
sourcepub fn is_on_left_hand(&self) -> bool
pub fn is_on_left_hand(&self) -> bool
Check if the key is on left hand, including left thumb.
sourcepub fn is_on_layer(&self, layer: &str) -> bool
pub fn is_on_layer(&self, layer: &str) -> bool
Check if the key is on a specific layer.
sourcepub fn is_char_key(&self) -> bool
pub fn is_char_key(&self) -> bool
Check if the key is of type Key::Char which outputs
a single character.
sourcepub fn is_word_key(&self) -> bool
pub fn is_word_key(&self) -> bool
Check if the key is of type Key::Word which outputs a specific
string.
sourcepub fn is_empty_key(&self) -> bool
pub fn is_empty_key(&self) -> bool
Check if the key is of type Key::Empty which doesn’t output
anything.
sourcepub fn is_transparent_key(&self) -> bool
pub fn is_transparent_key(&self) -> bool
Check if the key is of type Key::Transparent which outputs
whatever it is the main layer outputs in that position.
sourcepub fn is_layer_key(&self) -> bool
pub fn is_layer_key(&self) -> bool
Check if the key is of type Key::Layer which holds the name.
of a layer on the layout
sourcepub fn char_output(&self) -> Option<char>
pub fn char_output(&self) -> Option<char>
Get the output if the key is of type Key::Char.
sourcepub fn word_output(&self) -> Option<&str>
pub fn word_output(&self) -> Option<&str>
Get the output if the key is of type Key::Word.
sourcepub fn layer_output(&self) -> Option<&str>
pub fn layer_output(&self) -> Option<&str>
Get the layer name if the key is of type Key::Layer.
Trait Implementations§
source§impl Clone for DescriptiveKey
impl Clone for DescriptiveKey
source§fn clone(&self) -> DescriptiveKey
fn clone(&self) -> DescriptiveKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DescriptiveKey
impl Debug for DescriptiveKey
source§impl PartialEq for DescriptiveKey
impl PartialEq for DescriptiveKey
source§fn eq(&self, other: &DescriptiveKey) -> bool
fn eq(&self, other: &DescriptiveKey) -> bool
self and other values to be equal, and is used
by ==.