win, linux, single meta key
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
2c25be346c
commit
acac305441
@ -1371,13 +1371,13 @@ fn simulate_win2win_hotkey(code: u32, down: bool) {
|
|||||||
allow_err!(rdev::simulate_code(Some(keycode), None, down));
|
allow_err!(rdev::simulate_code(Some(keycode), None, down));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
#[cfg(not(any(target_os = "windows", target_os = "linux")))]
|
||||||
fn is_meta_key(_evt: &KeyEvent) -> bool {
|
fn is_win_linux_meta_key(_evt: &KeyEvent) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||||
fn is_meta_key(evt: &KeyEvent) -> bool {
|
fn is_win_linux_meta_key(evt: &KeyEvent) -> bool {
|
||||||
match evt.mode.unwrap() {
|
match evt.mode.unwrap() {
|
||||||
KeyboardMode::Map | KeyboardMode::Translate => match &evt.union {
|
KeyboardMode::Map | KeyboardMode::Translate => match &evt.union {
|
||||||
Some(key_event::Union::ControlKey(ck)) => {
|
Some(key_event::Union::ControlKey(ck)) => {
|
||||||
@ -1410,7 +1410,7 @@ pub fn handle_key_(evt: &KeyEvent) {
|
|||||||
Some(LockModesHandler::new(&evt))
|
Some(LockModesHandler::new(&evt))
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if evt.down && !is_meta_key(evt) {
|
if evt.down && !is_win_linux_meta_key(evt) {
|
||||||
Some(LockModesHandler::new(evt))
|
Some(LockModesHandler::new(evt))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user