mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
Ignore dead keys in Linux
This commit is contained in:
parent
1996a27c72
commit
5dfc41a7b8
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3795,7 +3795,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rdev"
|
||||
version = "0.5.0-2"
|
||||
source = "git+https://github.com/asur4s/rdev#d009906ba983f26c7b6f6f1a5e3c76bf43164294"
|
||||
source = "git+https://github.com/asur4s/rdev#c1175a394d811473e87ea79cb9a511a0f9b71764"
|
||||
dependencies = [
|
||||
"cocoa",
|
||||
"core-foundation 0.9.3",
|
||||
|
@ -1077,7 +1077,17 @@ impl Handler {
|
||||
let string = match KEYBOARD.lock() {
|
||||
Ok(mut keyboard) => {
|
||||
let string = keyboard.add(&evt.event_type).unwrap_or_default();
|
||||
if keyboard.last_is_dead && string == "" {
|
||||
#[cfg(target_os = "windows")]
|
||||
let is_dead = keyboard.last_is_dead;
|
||||
#[cfg(target_os = "linux")]
|
||||
let is_dead = unsafe {
|
||||
CStr::from_ptr(XKeysymToString(*keyboard.keysym))
|
||||
.to_str()
|
||||
.unwrap_or_default()
|
||||
.to_owned()
|
||||
.starts_with("dead")
|
||||
};
|
||||
if is_dead && string == "" {
|
||||
return;
|
||||
}
|
||||
string
|
||||
|
Loading…
Reference in New Issue
Block a user