pub struct Keysym(pub u32);Expand description
Input vocabulary, defined in crcbl_core::input and re-exported so a
consumer of the event stream needs one use rather than two.
See the crate docs for why these live in crcbl-core.
A layout-mapped key symbol, in the X11/XKB keysym numbering.
See the module docs for why that numbering. The values a game
actually wants are usually reachable through Keysym::to_char; the raw
number matters only for named function keys, which live above
0xFF00.
Tuple Fields§
§0: u32Implementations§
Source§impl Keysym
impl Keysym
Sourcepub const NONE: Keysym
pub const NONE: Keysym
No symbol — a key that produces nothing in the current layout, or a
backend that could not map one. XKB_KEY_NoSymbol.
Sourcepub const SCROLL_LOCK: Keysym
pub const SCROLL_LOCK: Keysym
XK_Scroll_Lock.
Sourcepub const KP_MULTIPLY: Keysym
pub const KP_MULTIPLY: Keysym
XK_KP_Multiply.
Sourcepub const KP_SUBTRACT: Keysym
pub const KP_SUBTRACT: Keysym
XK_KP_Subtract.
Sourcepub const KP_DECIMAL: Keysym
pub const KP_DECIMAL: Keysym
XK_KP_Decimal.
Sourcepub const fn to_char(self) -> Option<char>
pub const fn to_char(self) -> Option<char>
The character this symbol produces, if it produces one.
Implements the two rules XKB uses: keysyms 0x20..=0x7E and
0xA0..=0xFF are Latin-1 directly, and everything else that maps to a
character is 0x0100_0000 | codepoint. Function keys, modifiers and
dead keys return None.
This deliberately does not cover the several hundred legacy
non-Latin-1 keysyms that predate the Unicode block (Greek, Cyrillic and
friends in 0x05xx–0x07xx). Text input is delivered as committed
strings, not reconstructed from keysyms, so the table would exist only
to be wrong in a way nobody notices; a shortcut label falls back to the
KeyCode name.
Sourcepub const fn from_char(character: char) -> Keysym
pub const fn from_char(character: char) -> Keysym
The keysym for a character, in the canonical form XKB produces.
Sourcepub const fn is_none(self) -> bool
pub const fn is_none(self) -> bool
Whether this is Keysym::NONE.