commit
d588f513fb
@ -1,4 +1,5 @@
|
||||
use enigo::{Enigo, MouseButton, MouseControllable};
|
||||
#[cfg(windows)]
|
||||
use winapi::um::winuser::WHEEL_DELTA;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
@ -26,16 +27,28 @@ fn main() {
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
#[cfg(windows)]
|
||||
enigo.mouse_scroll_x(2 * WHEEL_DELTA as i32);
|
||||
#[cfg(not(windows))]
|
||||
enigo.mouse_scroll_x(2);
|
||||
thread::sleep(wait_time);
|
||||
|
||||
#[cfg(windows)]
|
||||
enigo.mouse_scroll_x(-2 * WHEEL_DELTA as i32);
|
||||
#[cfg(not(windows))]
|
||||
enigo.mouse_scroll_x(-2);
|
||||
thread::sleep(wait_time);
|
||||
|
||||
#[cfg(windows)]
|
||||
enigo.mouse_scroll_y(2 * WHEEL_DELTA as i32);
|
||||
#[cfg(not(windows))]
|
||||
enigo.mouse_scroll_y(2);
|
||||
thread::sleep(wait_time);
|
||||
|
||||
#[cfg(windows)]
|
||||
enigo.mouse_scroll_y(-2 * WHEEL_DELTA as i32);
|
||||
#[cfg(not(windows))]
|
||||
enigo.mouse_scroll_y(-2);
|
||||
thread::sleep(wait_time);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use crate::{
|
||||
common::make_fd_to_json,
|
||||
flutter::{self, SESSIONS},
|
||||
flutter::{session_add, session_start_},
|
||||
server::input_service::{
|
||||
server::{
|
||||
MOUSE_BUTTON_BACK, MOUSE_BUTTON_FORWARD, MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT,
|
||||
MOUSE_BUTTON_WHEEL, MOUSE_TYPE_DOWN, MOUSE_TYPE_TRACKPAD, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL,
|
||||
},
|
||||
|
@ -8,6 +8,8 @@ use std::{
|
||||
use bytes::Bytes;
|
||||
|
||||
pub use connection::*;
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
use hbb_common::config::Config2;
|
||||
use hbb_common::tcp::{self, new_listener};
|
||||
use hbb_common::{
|
||||
allow_err,
|
||||
@ -23,8 +25,6 @@ use hbb_common::{
|
||||
timeout, tokio, ResultType, Stream,
|
||||
};
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
use hbb_common::{anyhow::anyhow, config::Config2};
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
use service::ServiceTmpl;
|
||||
use service::{GenericService, Service, Subscriber};
|
||||
|
||||
@ -74,6 +74,18 @@ lazy_static::lazy_static! {
|
||||
pub static ref CLIENT_SERVER: ServerPtr = new();
|
||||
}
|
||||
|
||||
pub const MOUSE_TYPE_MOVE: i32 = 0;
|
||||
pub const MOUSE_TYPE_DOWN: i32 = 1;
|
||||
pub const MOUSE_TYPE_UP: i32 = 2;
|
||||
pub const MOUSE_TYPE_WHEEL: i32 = 3;
|
||||
pub const MOUSE_TYPE_TRACKPAD: i32 = 4;
|
||||
|
||||
pub const MOUSE_BUTTON_LEFT: i32 = 0x01;
|
||||
pub const MOUSE_BUTTON_RIGHT: i32 = 0x02;
|
||||
pub const MOUSE_BUTTON_WHEEL: i32 = 0x04;
|
||||
pub const MOUSE_BUTTON_BACK: i32 = 0x08;
|
||||
pub const MOUSE_BUTTON_FORWARD: i32 = 0x10;
|
||||
|
||||
pub struct Server {
|
||||
connections: ConnMap,
|
||||
services: HashMap<&'static str, Box<dyn Service>>,
|
||||
|
@ -15,6 +15,8 @@
|
||||
use super::*;
|
||||
use magnum_opus::{Application::*, Channels::*, Encoder};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
#[cfg(not(any(target_os = "linux", target_os = "android")))]
|
||||
use hbb_common::anyhow::anyhow;
|
||||
|
||||
pub const NAME: &'static str = "audio";
|
||||
pub const AUDIO_DATA_SIZE_U8: usize = 960 * 4; // 10ms in 48000 stereo
|
||||
|
@ -17,22 +17,11 @@ use std::{
|
||||
thread,
|
||||
time::{self, Duration, Instant},
|
||||
};
|
||||
#[cfg(windows)]
|
||||
use winapi::um::winuser::WHEEL_DELTA;
|
||||
|
||||
const INVALID_CURSOR_POS: i32 = i32::MIN;
|
||||
|
||||
pub const MOUSE_TYPE_MOVE: i32 = 0;
|
||||
pub const MOUSE_TYPE_DOWN: i32 = 1;
|
||||
pub const MOUSE_TYPE_UP: i32 = 2;
|
||||
pub const MOUSE_TYPE_WHEEL: i32 = 3;
|
||||
pub const MOUSE_TYPE_TRACKPAD: i32 = 4;
|
||||
|
||||
pub const MOUSE_BUTTON_LEFT: i32 = 0x01;
|
||||
pub const MOUSE_BUTTON_RIGHT: i32 = 0x02;
|
||||
pub const MOUSE_BUTTON_WHEEL: i32 = 0x04;
|
||||
pub const MOUSE_BUTTON_BACK: i32 = 0x08;
|
||||
pub const MOUSE_BUTTON_FORWARD: i32 = 0x10;
|
||||
|
||||
#[derive(Default)]
|
||||
struct StateCursor {
|
||||
hcursor: u64,
|
||||
|
@ -1002,12 +1002,6 @@ fn no_displays(displays: &Vec<Display>) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[cfg(not(windows))]
|
||||
fn no_displays(displays: &Vec<Display>) -> bool {
|
||||
displays.is_empty()
|
||||
}
|
||||
|
||||
#[cfg(all(windows, feature = "virtual_display_driver"))]
|
||||
fn try_get_displays() -> ResultType<Vec<Display>> {
|
||||
let mut displays = Display::all()?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user