Skip to content

Commit

Permalink
Merge pull request #246 from pentamassiv/0_2_0-rc1
Browse files Browse the repository at this point in the history
Bump version no to 0.2.0-rc1
  • Loading branch information
pentamassiv authored Nov 18, 2023
2 parents 1ca349c + 0d24224 commit bbc9c25
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
[package]
name = "enigo"
version = "0.1.3"
version = "0.2.0-rc1"
authors = [
"pentamassiv <[email protected]>",
"Dustin Bensing <[email protected]>",
]
edition = "2021"
rust-version = "1.65"
description = "Cross-platform (Linux, Windows & macOS) library to simulate keyboard and/or mouse events"
description = "Cross-platform (Linux, Windows & macOS) library to simulate keyboard and mouse events"
documentation = "https://docs.rs/enigo/"
homepage = "https://github.com/enigo-rs/enigo"
repository = "https://github.com/enigo-rs/enigo"
readme = "README.md"
keywords = ["input", "mouse", "testing", "keyboard", "automation"]
categories = ["development-tools::testing", "api-bindings", "hardware-support"]
keywords = ["simulate", "input", "mouse", "keyboard", "automation"]
categories = [
"development-tools::testing",
"api-bindings",
"hardware-support",
"os",
"simulation",
]
license = "MIT"
exclude = [".github", "examples", ".gitignore", "rustfmt.toml"]

Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

![Rust version](https://img.shields.io/badge/rust--version-1.65+-brightgreen.svg)
[![Crates.io](https://img.shields.io/crates/v/enigo.svg)](https://crates.io/crates/enigo)
[![Discord chat](https://img.shields.io/discord/315925376486342657.svg)](https://discord.gg/Eb8CsnN)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/enigo-rs/Lobby)

# enigo

Expand All @@ -19,17 +17,17 @@ Cross platform input simulation in Rust!
- [x] MacOS text
- [x] Win mouse
- [x] Win text
- [x] Custom Parser
- [x] Serialize/Deserialize

```Rust
let mut enigo = Enigo::new(&Settings::default()).unwrap();

enigo.mouse_move_to(500, 200);
enigo.mouse_click(Button::Left);
enigo.key_sequence_parse("{+CTRL}a{-CTRL}{+SHIFT}Hello World{-SHIFT}");
enigo.move_mouse(500, 200, Abs).unwrap();
enigo.button(Button::Left, Click).unwrap();
enigo.text("Hello World! here is a lot of text ❤️").unwrap();
```

For more look at examples
For more look at the examples.

## Runtime dependencies

Expand Down
2 changes: 1 addition & 1 deletion src/linux/wayland.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl Con {
fn get_time(&self) -> u32 {
let duration = self.base_time.elapsed();
let time = duration.as_millis();
time.try_into().unwrap()
time.try_into().unwrap_or(u32::MAX)
}

/// Press/Release a keycode
Expand Down
7 changes: 5 additions & 2 deletions src/linux/xdo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::{ffi::CString, ptr};
use std::{
ffi::{c_char, c_int, c_ulong, c_void, CString},
ptr,
};

use libc::{c_char, c_int, c_ulong, c_void, useconds_t};
use libc::useconds_t;

use log::debug;

Expand Down
4 changes: 1 addition & 3 deletions src/macos/macos_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,7 @@ impl Enigo {
#[must_use]
#[allow(clippy::missing_panics_doc)] // It never panics
pub fn delay(&self) -> u32 {
// Unwrapping here is okay, be cause we always initially have a u32 that gets
// converted to an u64. The reverse is always possible
self.delay.try_into().unwrap()
self.delay.try_into().unwrap_or(u32::MAX)
}

/// Set the delay per keypress in milliseconds
Expand Down

0 comments on commit bbc9c25

Please sign in to comment.