fix windows

This commit is contained in:
Ferdinand Schober
2024-07-01 17:16:36 +02:00
parent 3c2f9da5b7
commit db2004fd02
2 changed files with 10 additions and 2 deletions

View File

@@ -20,6 +20,8 @@ pub enum EmulationCreationError {
X11(#[from] X11EmulationCreationError),
#[cfg(target_os = "macos")]
MacOs(#[from] MacOSEmulationCreationError),
#[cfg(windows)]
Windows(#[from] WindowsEmulationCreationError),
NoAvailableBackend,
}
@@ -36,6 +38,8 @@ impl Display for EmulationCreationError {
EmulationCreationError::X11(e) => format!("x11 backend: {e}"),
#[cfg(target_os = "macos")]
EmulationCreationError::MacOs(e) => format!("macos backend: {e}"),
#[cfg(windows)]
EmulationCreationError::Windows(e) => format!("windows backend: {e}"),
EmulationCreationError::NoAvailableBackend => "no backend available".to_string(),
};
write!(f, "could not create input emulation backend: {reason}")
@@ -158,3 +162,7 @@ impl Display for MacOSEmulationCreationError {
}
}
}
#[cfg(windows)]
#[derive(Debug, Error)]
pub enum WindowsEmulationCreationError {}

View File

@@ -1,9 +1,9 @@
use super::error::WindowsEmulationCreationError;
use crate::{
emulate::InputEmulation,
event::{KeyboardEvent, PointerEvent},
scancode,
};
use anyhow::Result;
use async_trait::async_trait;
use std::ops::BitOrAssign;
use std::time::Duration;
@@ -33,7 +33,7 @@ pub struct WindowsEmulation {
}
impl WindowsEmulation {
pub fn new() -> Result<Self> {
pub fn new() -> Result<Self, WindowsEmulationCreationError> {
Ok(Self { repeat_task: None })
}
}