Struct keynergy::layout::Keys [−][src]
pub struct Keys {
pub matrix: Vec<Vec<char>>,
pub map: HashMap<char, Pos>,
pub home_row: u8,
pub thumb_row: Option<u8>,
}Fields
matrix: Vec<Vec<char>>map: HashMap<char, Pos>home_row: u8thumb_row: Option<u8>Implementations
Returns whether the keys contain a character or not.
Example
use keynergy::{Keys, Pos};
let qwerty = Keys::qwerty();
assert_eq!(qwerty.has_pos(Pos::new(0,0)), true);
assert_eq!(qwerty.has_pos(Pos::new(100,4)), false);Returns the character at the given position without checking if it’s valid.
Examples
use keynergy::{Keys, Pos};
let qwerty = Keys::qwerty();
assert_eq!(qwerty.pos_key_unsafe(Pos::new(0,0)), &'q');This example panics
ⓘ
use keynergy::{Keys, Pos};
let qwerty = Keys::qwerty();
let c = qwerty.pos_key_unsafe(Pos::new(100, 0));Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Keys
impl UnwindSafe for Keys
Blanket Implementations
Mutably borrows from an owned value. Read more
