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 { | ||||
|     let bytes = content.into_bytes(); | ||||
|     let compressed = compress_func(&bytes, COMPRESS_LEVEL); | ||||
| @ -467,4 +458,3 @@ pub fn is_ip(id: &str) -> bool { | ||||
|         .unwrap() | ||||
|         .is_match(id) | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -580,11 +580,9 @@ fn handle_key_(evt: &KeyEvent) { | ||||
|         } | ||||
|     } | ||||
|     #[cfg(not(target_os = "macos"))] | ||||
|     if crate::common::valid_for_capslock(evt) { | ||||
|         if has_cap != en.get_key_state(Key::CapsLock) { | ||||
|             en.key_down(Key::CapsLock).ok(); | ||||
|             en.key_up(Key::CapsLock); | ||||
|         } | ||||
|     if has_cap != en.get_key_state(Key::CapsLock) { | ||||
|         en.key_down(Key::CapsLock).ok(); | ||||
|         en.key_up(Key::CapsLock); | ||||
|     } | ||||
|     #[cfg(windows)] | ||||
|     if crate::common::valid_for_numlock(evt) { | ||||
|  | ||||
| @ -1031,17 +1031,11 @@ impl Handler { | ||||
|         { | ||||
|             key_event.modifiers.push(ControlKey::Meta.into()); | ||||
|         } | ||||
|         /* | ||||
|         if crate::is_control_key(&key_event, &ControlKey::CapsLock) { | ||||
|             return; | ||||
|         } else if get_key_state(enigo::Key::CapsLock) && common::valid_for_capslock(&key_event) { | ||||
|         if get_key_state(enigo::Key::CapsLock) { | ||||
|             key_event.modifiers.push(ControlKey::CapsLock.into()); | ||||
|         } | ||||
|         */ | ||||
|         if self.peer_platform() != "Mac OS" { | ||||
|             if crate::is_control_key(&key_event, &ControlKey::NumLock) { | ||||
|                 return; | ||||
|             } else if get_key_state(enigo::Key::NumLock) && common::valid_for_numlock(&key_event) { | ||||
|             if get_key_state(enigo::Key::NumLock) && common::valid_for_numlock(&key_event) { | ||||
|                 key_event.modifiers.push(ControlKey::NumLock.into()); | ||||
|             } | ||||
|         } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user