remove valid_for_capslock
This commit is contained in:
parent
3212290f6e
commit
ae79a36f7b
@ -40,15 +40,6 @@ pub fn valid_for_numlock(evt: &KeyEvent) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn valid_for_capslock(evt: &KeyEvent) -> bool {
|
|
||||||
if let Some(key_event::Union::chr(ch)) = evt.union {
|
|
||||||
ch >= 'a' as u32 && ch <= 'z' as u32
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn create_clipboard_msg(content: String) -> Message {
|
pub fn create_clipboard_msg(content: String) -> Message {
|
||||||
let bytes = content.into_bytes();
|
let bytes = content.into_bytes();
|
||||||
let compressed = compress_func(&bytes, COMPRESS_LEVEL);
|
let compressed = compress_func(&bytes, COMPRESS_LEVEL);
|
||||||
@ -467,4 +458,3 @@ pub fn is_ip(id: &str) -> bool {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.is_match(id)
|
.is_match(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,11 +580,9 @@ fn handle_key_(evt: &KeyEvent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
if crate::common::valid_for_capslock(evt) {
|
if has_cap != en.get_key_state(Key::CapsLock) {
|
||||||
if has_cap != en.get_key_state(Key::CapsLock) {
|
en.key_down(Key::CapsLock).ok();
|
||||||
en.key_down(Key::CapsLock).ok();
|
en.key_up(Key::CapsLock);
|
||||||
en.key_up(Key::CapsLock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
if crate::common::valid_for_numlock(evt) {
|
if crate::common::valid_for_numlock(evt) {
|
||||||
|
@ -1031,17 +1031,11 @@ impl Handler {
|
|||||||
{
|
{
|
||||||
key_event.modifiers.push(ControlKey::Meta.into());
|
key_event.modifiers.push(ControlKey::Meta.into());
|
||||||
}
|
}
|
||||||
/*
|
if get_key_state(enigo::Key::CapsLock) {
|
||||||
if crate::is_control_key(&key_event, &ControlKey::CapsLock) {
|
|
||||||
return;
|
|
||||||
} else if get_key_state(enigo::Key::CapsLock) && common::valid_for_capslock(&key_event) {
|
|
||||||
key_event.modifiers.push(ControlKey::CapsLock.into());
|
key_event.modifiers.push(ControlKey::CapsLock.into());
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
if self.peer_platform() != "Mac OS" {
|
if self.peer_platform() != "Mac OS" {
|
||||||
if crate::is_control_key(&key_event, &ControlKey::NumLock) {
|
if get_key_state(enigo::Key::NumLock) && common::valid_for_numlock(&key_event) {
|
||||||
return;
|
|
||||||
} else if get_key_state(enigo::Key::NumLock) && common::valid_for_numlock(&key_event) {
|
|
||||||
key_event.modifiers.push(ControlKey::NumLock.into());
|
key_event.modifiers.push(ControlKey::NumLock.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user