Refactor for compiler in linux
This commit is contained in:
parent
ce3434fd37
commit
3a0c10bdb1
@ -257,7 +257,7 @@ pub enum Key {
|
|||||||
Backspace,
|
Backspace,
|
||||||
/// caps lock key
|
/// caps lock key
|
||||||
CapsLock,
|
CapsLock,
|
||||||
#[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
// #[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
||||||
/// command key on macOS (super key on Linux, windows key on Windows)
|
/// command key on macOS (super key on Linux, windows key on Windows)
|
||||||
Command,
|
Command,
|
||||||
/// control key
|
/// control key
|
||||||
@ -314,14 +314,14 @@ pub enum Key {
|
|||||||
Shift,
|
Shift,
|
||||||
/// space key
|
/// space key
|
||||||
Space,
|
Space,
|
||||||
#[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
// #[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
||||||
/// super key on linux (command key on macOS, windows key on Windows)
|
/// super key on linux (command key on macOS, windows key on Windows)
|
||||||
Super,
|
Super,
|
||||||
/// tab key (tabulator)
|
/// tab key (tabulator)
|
||||||
Tab,
|
Tab,
|
||||||
/// up arrow key
|
/// up arrow key
|
||||||
UpArrow,
|
UpArrow,
|
||||||
#[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
// #[deprecated(since = "0.0.12", note = "now renamed to Meta")]
|
||||||
/// windows key on Windows (super key on Linux, command key on macOS)
|
/// windows key on Windows (super key on Linux, command key on macOS)
|
||||||
Windows,
|
Windows,
|
||||||
///
|
///
|
||||||
|
@ -3,7 +3,7 @@ use libc;
|
|||||||
use crate::{Key, KeyboardControllable, MouseButton, MouseControllable};
|
use crate::{Key, KeyboardControllable, MouseButton, MouseControllable};
|
||||||
|
|
||||||
use self::libc::{c_char, c_int, c_void, useconds_t};
|
use self::libc::{c_char, c_int, c_void, useconds_t};
|
||||||
use std::{borrow::Cow, ffi::CString, io::prelude::*, ptr, sync::mpsc};
|
use std::{borrow::Cow, ffi::CString, ptr};
|
||||||
|
|
||||||
const CURRENT_WINDOW: c_int = 0;
|
const CURRENT_WINDOW: c_int = 0;
|
||||||
const DEFAULT_DELAY: u64 = 12000;
|
const DEFAULT_DELAY: u64 = 12000;
|
||||||
|
@ -2,7 +2,7 @@ use super::*;
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use dispatch::Queue;
|
use dispatch::Queue;
|
||||||
use enigo::{Enigo, Key, KeyboardControllable, MouseButton, MouseControllable};
|
use enigo::{Enigo, Key, KeyboardControllable, MouseButton, MouseControllable};
|
||||||
use hbb_common::{config::COMPRESS_LEVEL, protobuf::ProtobufEnumOrUnknown, protobuf::EnumOrUnknown};
|
use hbb_common::{config::COMPRESS_LEVEL, protobuf::EnumOrUnknown};
|
||||||
use rdev::{simulate, EventType, Key as RdevKey};
|
use rdev::{simulate, EventType, Key as RdevKey};
|
||||||
use std::{
|
use std::{
|
||||||
convert::TryFrom,
|
convert::TryFrom,
|
||||||
@ -654,7 +654,7 @@ fn sync_status(evt: &KeyEvent) {
|
|||||||
fn map_keyboard_map(evt: &KeyEvent) {
|
fn map_keyboard_map(evt: &KeyEvent) {
|
||||||
// map mode(1): Send keycode according to the peer platform.
|
// map mode(1): Send keycode according to the peer platform.
|
||||||
sync_status(evt);
|
sync_status(evt);
|
||||||
rdev_key_down_or_up(RdevKey::Unknown(evt.get_chr()), evt.down);
|
rdev_key_down_or_up(RdevKey::Unknown(evt.chr()), evt.down);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user