ignore modifiers for name
This commit is contained in:
parent
3a6dc19616
commit
e2a879692d
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2958,7 +2958,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "rdev"
|
name = "rdev"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "git+https://github.com/open-trade/rdev#bc1d62c9966a56eecc5de61b1dee43dfc80ec141"
|
source = "git+https://github.com/open-trade/rdev#2a3205a13102907da2442a369f8b704601eecc9d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa 0.22.0",
|
"cocoa 0.22.0",
|
||||||
"core-foundation 0.7.0",
|
"core-foundation 0.7.0",
|
||||||
|
@ -233,8 +233,6 @@ impl Handler {
|
|||||||
let mut me = self.clone();
|
let mut me = self.clone();
|
||||||
let peer = self.peer_platform();
|
let peer = self.peer_platform();
|
||||||
let is_win = peer == "Windows";
|
let is_win = peer == "Windows";
|
||||||
let version = self.lc.read().unwrap().version;
|
|
||||||
const OFFSET_CASE: u8 = 'a' as u8 - 'A' as u8;
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
// This will block.
|
// This will block.
|
||||||
std::env::set_var("KEYBOARD_ONLY", "y"); // pass to rdev
|
std::env::set_var("KEYBOARD_ONLY", "y"); // pass to rdev
|
||||||
@ -331,7 +329,7 @@ impl Handler {
|
|||||||
if let Some(k) = control_key {
|
if let Some(k) = control_key {
|
||||||
key_event.set_control_key(k);
|
key_event.set_control_key(k);
|
||||||
} else {
|
} else {
|
||||||
let mut chr = match evt.name {
|
let chr = match evt.name {
|
||||||
Some(ref s) => s.chars().next().unwrap_or('\0'),
|
Some(ref s) => s.chars().next().unwrap_or('\0'),
|
||||||
_ => '\0',
|
_ => '\0',
|
||||||
};
|
};
|
||||||
@ -340,10 +338,6 @@ impl Handler {
|
|||||||
me.lock_screen();
|
me.lock_screen();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// <= 1.1.8, caps modifier only for 'a' -> 'z', so here adjust it
|
|
||||||
if version <= 1001008 && chr >= 'A' && chr <= 'Z' {
|
|
||||||
chr = (chr as u8 + OFFSET_CASE) as _;
|
|
||||||
}
|
|
||||||
key_event.set_chr(chr as _);
|
key_event.set_chr(chr as _);
|
||||||
} else {
|
} else {
|
||||||
log::error!("Unknown key {:?}", evt);
|
log::error!("Unknown key {:?}", evt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user