Struct Keycaps
pub struct Keycaps {
pub language: KeycapLanguage,
pub family: KeyboardFamily,
}Expand description
The legends of one keyboard: its layout’s language and whether it is an Apple keyboard.
Fields§
§language: KeycapLanguage§family: KeyboardFamilyImplementations§
§impl Keycaps
impl Keycaps
pub fn from_xkb(layout: &str, variant: &str) -> Keycaps
pub fn from_xkb(layout: &str, variant: &str) -> Keycaps
The legends of XKB layout layout with variant variant (empty for
the base layout). Mac variants (mac, de_mac, mac_nodeadkeys, …)
describe Apple keyboards.
pub fn on_family(self, family: KeyboardFamily) -> Keycaps
pub fn on_family(self, family: KeyboardFamily) -> Keycaps
The same layout on a keyboard of family. An Apple keyboard stays
Apple: its keycaps carry symbols whatever the layout says.
pub fn modifier(self, modifier: KeyboardModifier) -> &'static str
pub fn modifier(self, modifier: KeyboardModifier) -> &'static str
What is printed on modifier.
pub fn native_symbol(self, name: &str, text: &str) -> String
pub fn native_symbol(self, name: &str, text: &str) -> String
Format native keysym metadata without composing text or applying Ctrl transformations. Shared by static previews and the focused-seat map.
pub fn key(self, name: &str) -> String
pub fn key(self, name: &str) -> String
What is printed on the key with canonical name name (pageup,
escape, f4, k): a single character upper-cased (unless its
capital is more than one letter, like ß), a function key
as F4, and a name this table does not know as given.
pub fn chord<'a>(
self,
modifiers: impl IntoIterator<Item = &'a str>,
key: &str,
) -> String
pub fn chord<'a>( self, modifiers: impl IntoIterator<Item = &'a str>, key: &str, ) -> String
A canonical chord (["Super", "Shift"], "s") as the keyboard spells
it. PC legends are joined with +; Apple symbols are written
together, as Apple does (⌘⇧S). Modifiers are always listed in the
same order, Super first, whatever order they were given in.
Trait Implementations§
impl Copy for Keycaps
impl Eq for Keycaps
impl StructuralPartialEq for Keycaps
Auto Trait Implementations§
impl Freeze for Keycaps
impl RefUnwindSafe for Keycaps
impl Send for Keycaps
impl Sync for Keycaps
impl Unpin for Keycaps
impl UnsafeUnpin for Keycaps
impl UnwindSafe for Keycaps
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more