Skip to content

Commit 37ded56

Browse files
committed
Semi working state.
1 parent de99d6b commit 37ded56

File tree

6 files changed

+408
-192
lines changed

6 files changed

+408
-192
lines changed

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ pub use crate::rdev::{
226226
#[cfg(target_os = "macos")]
227227
mod macos;
228228
#[cfg(target_os = "macos")]
229-
pub use crate::macos::{set_is_main_thread, Keyboard};
230-
#[cfg(target_os = "macos")]
231229
use crate::macos::{display_size as _display_size, listen as _listen, simulate as _simulate};
230+
#[cfg(target_os = "macos")]
231+
pub use crate::macos::{set_is_main_thread, Keyboard};
232232

233233
#[cfg(target_os = "linux")]
234234
mod linux;
@@ -305,7 +305,8 @@ where
305305
/// }
306306
/// ```
307307
pub fn simulate(event_type: &EventType) -> Result<(), SimulateError> {
308-
_simulate(event_type)
308+
_simulate(event_type)?;
309+
Ok(())
309310
}
310311

311312
/// Returns the size in pixels of the main screen.

src/linux/wayland/keyboard.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
use crate::rdev::{EventType, KeyboardState};
1+
use crate::{
2+
rdev::{EventType, KeyboardState},
3+
SimulateError,
4+
};
25

36
#[derive(Debug)]
47
pub struct Keyboard {}
58

9+
impl Keyboard {
10+
pub fn new() -> Result<Self, SimulateError> {
11+
Ok(Self {})
12+
}
13+
}
14+
615
impl KeyboardState for Keyboard {
716
fn add(&mut self, _event_type: &EventType) -> Option<String> {
817
None

0 commit comments

Comments
 (0)