#![cfg(feature = "displayserver")]
#[cfg(target_os = "linux")]
use hid_io_core::module::displayserver::x11::*;
#[cfg(target_os = "linux")]
use hid_io_core::module::displayserver::wayland::*;
#[cfg(target_os = "macos")]
use hid_io_core::module::displayserver::quartz::*;
#[cfg(target_os = "windows")]
use hid_io_core::module::displayserver::winapi::*;
use hid_io_core::module::displayserver::DisplayOutput;
#[cfg(target_os = "linux")]
fn get_display() -> Box<dyn DisplayOutput> {
let wayland = WaylandConnection::new();
if let Ok(wayland) = wayland {
Box::new(wayland)
} else {
Box::new(XConnection::new())
}
}
pub fn main() {
hid_io_core::logging::setup_logging_lite().unwrap();
#[cfg(target_os = "linux")]
let mut connection = get_display();
#[cfg(target_os = "macos")]
let mut connection = QuartzConnection::new();
#[cfg(target_os = "windows")]
let mut connection = DisplayConnection::new();
log::info!("START");
connection.type_string("💣💩🔥").unwrap(); connection.type_string("abc💣💩🔥🔥").unwrap(); connection.type_string("\n").unwrap(); connection.type_string("carg\t --help\n").unwrap();
connection.set_held("def").unwrap();
connection.set_held("gã‚¢i").unwrap();
std::thread::sleep(std::time::Duration::from_millis(1000)); connection.set_held("gã‚¢").unwrap();
std::thread::sleep(std::time::Duration::from_millis(1000)); connection.set_held("").unwrap();
log::info!("END");
}