mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
working on keysym
This commit is contained in:
@@ -418,6 +418,8 @@ pub enum Key {
|
||||
Layout(char),
|
||||
/// raw keycode eg 0x38
|
||||
Raw(u16),
|
||||
/// VNC keysym
|
||||
KeySym(u32),
|
||||
}
|
||||
|
||||
/// Representing an interface and a set of keyboard functions every
|
||||
|
||||
@@ -181,6 +181,9 @@ impl MouseControllable for Enigo {
|
||||
}
|
||||
}
|
||||
fn keysequence<'a>(key: Key) -> Cow<'a, str> {
|
||||
if let Key::KeySym(sym) = key {
|
||||
return Cow::Owned("");
|
||||
}
|
||||
if let Key::Layout(c) = key {
|
||||
return Cow::Owned(format!("U{:X}", c as u32));
|
||||
}
|
||||
|
||||
@@ -426,6 +426,7 @@ impl Enigo {
|
||||
|
||||
Key::Raw(raw_keycode) => raw_keycode,
|
||||
Key::Layout(c) => self.map_key_board(c),
|
||||
Key::KeySym(sym) => 0 as _,
|
||||
|
||||
Key::Super | Key::Command | Key::Windows | Key::Meta => kVK_Command,
|
||||
_ => 0,
|
||||
|
||||
@@ -340,6 +340,7 @@ impl Enigo {
|
||||
Key::Raw(raw_keycode) => raw_keycode,
|
||||
Key::Layout(c) => self.get_layoutdependent_keycode(c.to_string()),
|
||||
Key::Super | Key::Command | Key::Windows | Key::Meta => EVK_LWIN,
|
||||
Key::KeySym(sym) => 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ message KeyEvent {
|
||||
uint32 chr = 4;
|
||||
uint32 unicode = 5;
|
||||
string seq = 6;
|
||||
uint32 keysym = 7;
|
||||
}
|
||||
repeated ControlKey modifiers = 8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user