Struct cskk::keyevent::CskkKeyEvent
source · pub struct CskkKeyEvent { /* private fields */ }
Expand description
In-lib structure of key event
String representation of key event is paren enclosed LongModifiers and single KeyName, or just one ShortModifier and one KeyName joined, or single KeyName. LongModifier := “control” | “meta” | “alt” | “lshift” | “rshift” | “shift” ShortModifier := “C-” | “A-” | “M-” | “G-” for ctrl, mod1, meta, mod5 respectively KeyName := ↓ https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h https://xkbcommon.org/doc/current/xkbcommon_8h.html#a79e604a22703391bdfe212cfc10ea007
e.g. “(control a)” “C-a” “M-Left” “l” “space”
Implementations§
source§impl CskkKeyEvent
impl CskkKeyEvent
sourcepub fn from_keysym_with_flags(
keysym: Keysym,
ctrl_mod: bool,
shift_mod: bool,
alt_mod: bool
) -> Self
pub fn from_keysym_with_flags( keysym: Keysym, ctrl_mod: bool, shift_mod: bool, alt_mod: bool ) -> Self
Get a keyevent used in cskk.
TODO: Switch to another interface that accepts ModMap of xkb instead of each bool when xkbcommon lib can handle them better.
sourcepub fn from_string_representation(key: &str) -> Result<CskkKeyEvent, CskkError>
pub fn from_string_representation(key: &str) -> Result<CskkKeyEvent, CskkError>
string representation to KeyEvent. When parsing fails keysym is likely to be a voidsymbol
Testing purpose and not intended to be used from library users. May delete this interface at any update.
Use from_keysym_with_flags
for now instead.
sourcepub fn deserialize_seq(from: &str) -> Result<KeyEventSeq, CskkError>
pub fn deserialize_seq(from: &str) -> Result<KeyEventSeq, CskkError>
Mostly testing purpose. May delete this interface at any update.
Use from_keysym_with_flags
for now instead.
Trait Implementations§
source§impl Clone for CskkKeyEvent
impl Clone for CskkKeyEvent
source§fn clone(&self) -> CskkKeyEvent
fn clone(&self) -> CskkKeyEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CskkKeyEvent
impl Debug for CskkKeyEvent
source§impl<'de> Deserialize<'de> for CskkKeyEvent
impl<'de> Deserialize<'de> for CskkKeyEvent
source§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>,
source§impl Display for CskkKeyEvent
impl Display for CskkKeyEvent
source§impl FromStr for CskkKeyEvent
impl FromStr for CskkKeyEvent
source§impl Hash for CskkKeyEvent
impl Hash for CskkKeyEvent
source§impl PartialEq for CskkKeyEvent
impl PartialEq for CskkKeyEvent
source§fn eq(&self, other: &CskkKeyEvent) -> bool
fn eq(&self, other: &CskkKeyEvent) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for CskkKeyEvent
impl StructuralPartialEq for CskkKeyEvent
Auto Trait Implementations§
impl RefUnwindSafe for CskkKeyEvent
impl Send for CskkKeyEvent
impl Sync for CskkKeyEvent
impl Unpin for CskkKeyEvent
impl UnwindSafe for CskkKeyEvent
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.