# Unreleased ## Changed - linux: Changed order of the protocols to from libei > wayland > x11 to now wayland > x11 > libei - linux: Split the features `libei_smol`, `libei_tokio` into the feature `libei` to enable the libei protocol and the mutually exclusive features `smol` and `tokio` to select the async runtime - linux: libei: Prefer `ei_text.keysym` / `ei_text.utf8` when available; fall back to keymap `ei_keyboard` only when needed - linux: libei: Use `ei_scroll.scroll_discrete` with 120-unit notches for wheel scrolling instead of smooth `scroll` - linux: wayland: Use `axis_discrete` with a wheel axis source for `scroll()` instead of continuous `axis` - all: `Mouse::smooth_scroll` is no longer gated behind the `platform_specific` feature (supported on macOS, Windows, and Linux via xdg_desktop/Wayland/libei; X11 returns an error) - all: MSRV is 1.87 - win: `main_display()` and `location()` temporarily use a per-monitor DPI awareness thread context so coordinates stay correct without changing the process DPI mode ## Added - win: added smooth scrolling via high-resolution `MOUSEEVENTF_WHEEL` / `MOUSEEVENTF_HWHEEL` deltas (`120` = one notch; effect depends on whether the target app handles sub-120 deltas) - linux: xdg_desktop: added smooth scrolling via `NotifyPointerAxis` - linux: wayland: added smooth scrolling via continuous `axis` events (`AxisSource::Continuous`) - linux: libei: added smooth scrolling via `ei_scroll.scroll` - linux: libei/xdg_desktop: support passing a `restore_token` via `Settings` when establishing a connection, avoiding repeated user prompts for input simulation - linux: libei/xdg_desktop: expose a `restore_token()` getter so callers can retrieve and reuse the token - linux: added new protocol to simulate input. It uses the xdg_desktop portal and should work in flatpaks. Try it out with the `xdg_desktop` feature ## Removed - win: Removed `set_dpi_awareness()`. Enigo now handles DPI awareness internally where needed - win: `EXT` constant was removed, because it was incorrect and obsolete - all: Removed the function `delay` and `set_delay` as they no longer serve a purpose - all: Removed the field `linux_delay` from `Settings` struct as it no longer serves a purpose - linux: libei: Removed `Clone` derive from `Con` ## Fixed - win: Mouse coordinates and display size are no longer wrong when the process is not DPI aware - linux: Record pressed keys/keycodes in `held()` again after a successful `key()`/`raw()` (regression from protocol retry refactor) - linux: libei: Send `ei_device.ready` on device v3+ after `done` so servers waiting for `EIS_FLAG_DEVICE_READY` resume devices - linux: libei: Fix `frame` / `start_emulating` serial vs sequence handling - linux: libei: Re-send `start_emulating` after pause/resume so events are not silently discarded - linux: libei: Use the keymap and active layout group of the keyboard that receives the event - linux: libei: Don't underflow when converting X11 keycodes below 8 in `raw()` and keymap `key()` - linux: libei: Surface EIS disconnect instead of a generic "no device" error - linux: libei: Drop keymap/device/seat state on destroy and invalid-object paths - linux: libei: Don't sleep on every `update()`; flush then drain until idle - linux: Added `NumpadEnter` key - win: Added `NumpadEnter` key - win: Extended keys can now be correctly simulated with the raw() function. - macos: `move_mouse` no longer needs a sleep. - macos: always get the current main display and not the main display when the `enigo` struct was created - macos: allow dragging all mouse buttons - macos: fix crash by executing TIS keyboard layout retrieval on the main thread - linux: retry with a different protocol when encountering an error # 0.6.1 ## Fixed - docs.rs: Fixed build by only activating the `libei_smol` feature and not `libei_tokio` # 0.6.0 ## Changed - linux: libei: Replaced `libei` feature with `libei_tokio` and `libei_smol` ## Added - all: So far only functions that were possible on all platforms were implemented in order to keep every thing cross-platform. The new feature `platform_specific` allows you to opt-in to functionality that is only available on one or more platforms. At the beginning the only new platform specific function is smooth scrolling on macOS. - macos: added smooth scrolling (only available on macos and hidden behind the `platform_specific` feature) - linux: libei: Chose which async runtime you want to use ## Removed ## Fixed - linux: libei: The library can now be used inside a Tokio runtime. Previously that was not possible, because it would attempt to start a runtime from within another runtime. # 0.5.0 ## Changed - linux: x11: Use `x11rb` by default to simulate input as it is more reliable, makes it possible to enter raw keycodes, does not need `xdotools` as a runtime dependency and uses native Rust. If you experience issue with the new default, please open an issue. You can disable default features and use the feature `xdo` to use the old method. ## Added ## Removed ## Fixed # 0.4.2 ## Fixed -linux: xdo: Enable entering all unicode characters with the `key` function -linux: wayland: Enable entering all unicode characters with the `key` function # 0.4.1 ## Changed ## Added - macOS: The `Enigo` struct implements `Sync`/`Send` ## Removed ## Fixed - linux: wayland: Fix releasing raw keys - linux: wayland: Don't try to use the input_method protocol if it is unavailable - linux: wayland: The `Enigo` struct implements `Sync`/`Send` again # 0.4.0 ## Changed - Rust: MSRV is 1.85 - Rust: Use edition 2024 - linux: wayland: Use the keymap the compositor sends instead of a hardcoded one ## Added - macOS: Add to support Mouse special key(Back, Forward) - win: Helper function to tell Windows to respect the users scaling settings `set_dpi_awareness`. Read the docs before using it - linux: Add support for numpad keys (e.g. `Key::Numpad2`) - macOS: Add support for numpad keys (e.g. `Key::Numpad2`) - linux: wayland: Implement `main_display()`. It only works reliably if only one screen is connected ## Removed ## Fixed - linux: wayland: Fix the serial number of input_method events - linux: wayland: Correct whitespace and nullbyte at the end of the keymap - linux: wayland: Send messages in the correct order and make sure Wayland objects are created before they are used - linux: wayland: Fix moving the mouse to an absolute coordinate - linux: wayland: Don't hang when using Sway - linux: wayland: Fix simulating modifiers - linux: x11rb: Fix not being able to enter right modifier keys [#391](https://github.com/enigo-rs/enigo/issues/391) - linux: x11rb: Don't assume a modifier mapping and get the modifier mapping dynamically instead [#410](https://github.com/enigo-rs/enigo/issues/410) - linux: x11rb: Successfully enter the first simulated character as well # 0.3.0 ## Changed - all: The keys `Print` and `Snapshot` were deprecated because `Print` had the wrong virtual key associated with it on Windows. Use `Key::PrintScr` instead - macOS: The simulated input is no longer effected by the state of the physical keyboard. This default behavior can be changed via the Settings (`independent_of_keyboard_state`) - macOS: Do not coalesce mouse events to allow precise control - win: Fallback to entering a `Key::Unicode` as unicode if there is no key with that character - macOS: Removed setting and functions related to the delay on macOS because a sleep is no longer necessary ## Added - all: `Key::PrintScr` - all: There finally are some tests in the CI to increase the development speed and prevent regressions - win, macOS: Allow marking events that were created by enigo. Have a look at the additional field of the `Settings` struct and the new method `get_marker_value` of the `Enigo` struct (only available on Windows and macOS) - macOS: Fallback to ASCII-capable keyboard layout for handling non-standard input sources - macOS: Check if the application has the necessary permissions. If they are missing, `enigo` will ask the user to grant them. You can change this default behavior with the `Settings` when constructing an `Enigo` struct. - all: Added `Token::Location` and `Token::MainDisplay` mostly for debugging purposes. They allow you to check if your expectations are correct - win: Added a setting to take the mouse speed and acceleration level into account for relative mouse movement or reliably move the mouse to the expected location. ## Removed ## Fixed - macOS: No more sleeps!! (Only when the `Enigo` struct is dropped) ([#105](https://github.com/enigo-rs/enigo/issues/105)) - win: Respect the language of the current window to determine which scancodes to send - win: Send the virtual key and its scan code in the events to work with programs that only look at one of the two - macOS: Moving the mouse no longer breaks simulating input - win: Fix being unable to enter text containing multiple newline chars - macOS: Switched keycodes of `Key::Launchpad` and `Key::MissionControl` - macOS: `CapsLock` works ([#163](https://github.com/enigo-rs/enigo/issues/163)) - macOS: Moving the mouse works also if it is the only function ([#182](https://github.com/enigo-rs/enigo/issues/182)) - linux: libei: Typing is much faster now # 0.2.1 ## Changed - all: Use serde(default) to make the serialized strings less verbose ## Added - all: Serialized tokens can be less verbose because serde aliases were added - win, macOS: Allow marking events that were created by enigo. Have a look at the additional field of the `Settings` struct and the new method `get_marker_value` of the `Enigo` struct (only available on Windows and macOS) - all: The enums `Button`, `Direction`, `Axis` and `Coordinate` implement `Default` ## Fixed - windows: The `move_mouse` function moves the mouse to the correct absolute coordinates again # 0.2.0 ## Changed - All: A new Enigo struct is now always created with some settings - Rust: MSRV is 1.75 - All held keys are released when Enigo is dropped - win: Don't panic if it was not possible to move the mouse - All: Never panic! All functions return Results now - win: Don't move the mouse to a relative position if it was not possible to get the current position - All: The feature `with_serde` was renamed to `serde` - All: Renamed `Key::Layout(char)` to `Key::Unicode(char)` and clarified its docs - All: Split off entering raw keycodes into it's own function - All: Renamed `key_sequence` function to `text` - All: Renamed `enter_key` function to `key` - All: Renamed `send_mouse_button_event` function to `button` - All: Renamed `send_motion_notify_event` function to `move_mouse` - All: Renamed `mouse_scroll_event` function to `scroll` - All: Renamed `mouse_location` function to `location` - All: Renamed `MouseButton` enum to `Button` - DSL: The DSL was removed and replaced with the `Agent` trait. Activate the `serde` feature to use it. Have a look at the `serde` example to get an idea how to use it ## Added - Linux: Partial support for `libei` was added. Use the experimental feature `libei` to test it. This works on GNOME 46 and above. Entering text often simulates the wrong characters. - Linux: Support X11 without `xdotools`. Use the experimental feature `x11rb` to test it - Linux: Partial support for Wayland was added. Use the experimental feature `wayland` to test it. Only the virtual_keyboard and input_method protocol can be used. This is not going to work on GNOME, but should work for example with phosh - Linux: Added `MicMute` key to enter `XF86_AudioMicMute` keysym - win: Use DirectInput in addition to the SetCursorPos function in order to support DirectX - All: You can now chose how long the delay between keypresses should be on each platform and change it during the runtime - All: You can now use a logger to investigate errors ## Fixed - *BSD: Fix the build for BSDs - macOS: Add info how much a mouse was moved relative to the last position - macOS: A mouse drag with the right key is now possible too - win, linux: `key_sequence()` and `key_click(Key::Layout())` can properly enter new lines and tabs - linux: You can enter `Key::ScrollLock` now - win: No more sleeps! Simulating input is done in 1 ms instead of 40+ ms. This is most obvious when entering long strings - macOS: Added keys to control media, brightness, contrast, illumination and more - macOS: Fix entering text that starts with newline characters # 0.1.3 ## Changed ## Added - Linux: Add Media and Volume keys ## Fixed - Linux: Fixed a Segfault when running in release mode # 0.1.2 ## Changed - Windows: Bumped `windows` dependency to `0.48` because `0.47` was yanked. # 0.1.1 ## Changed - Windows: `Key::Control` presses `Control` and no longer the left `Control`. ## Added - all: Added a ton of keys (e.g F21-F24 keys and the XBUTTON1 & XBUTTON2 mouse buttons are now available on Windows). Some of them are OS specific. Use conditional compilation (e.g `#[cfg(target_os = "windows")]`) to use them to not break the build on other OSs. - examples: New example `platform_specific.rs` to demonstrate how to use keys/buttons that are platform specific ## Fixed - macOS: Fixed entering Key::Layout # 0.1.0 We should have bumped the minor version with the last release. Sorry about that. Have a look at the changes of 0.0.15 if you come from an earlier version. # 0.0.15 ## Changed - Windows: `mouse_scroll_y` with a positive number scrolls down just like on the other platforms - Windows: replaced `winapi` with the official `windows` crate - Rust: Using Rust version 2021 - Rust: Minimum supported Rust version (MSRV) is set in Cargo.toml - Rust: MSRV is 1.64 - macOS, Windows: Moved the functions `main_display_size` and `mouse_location` from `Enigo` to `MouseControllable` ## Added - DSL: Additional ParseError variants to give better feedback what the problem was - DSL: Additional keys - All: Added support for F10-F20 - CI/CD: Github Workflows to make sure the code builds and the tests pass - Traits: Added the functions `main_display_size` and `mouse_location` to `MouseControllable` - Linux: Implemented the functions `main_display_size` and `mouse_location` for `MouseControllable` ## Fixed - Windows: panicked at `cannot transmute_copy if U is larger than T` (https://github.com/enigo-rs/enigo/issues/121) - Windows: Inconsistent behavior between the `mouse_move_relative` and `mouse_move_to` functions (https://github.com/enigo-rs/enigo/issues/91) - Windows, macOS: Stop panicking when `mouse_down` or `mouse_up` is called with either of `MouseButton::ScrollUp`, `MouseButton::ScrollDown`, `MouseButton::ScrollLeft`, `MouseButton::ScrollRight` and instead scroll - Windows: Always use key codes to be layout independent. Only use scan codes for `Key::Layout` (Fixes https://github.com/enigo-rs/enigo/issues/99, https://github.com/enigo-rs/enigo/issues/84) - macOS: `key_click` no longer triggers a segmentation fault when called with `Key::Layout` argument (Fixes https://github.com/enigo-rs/enigo/issues/124) - macOS: Double clicks now work (https://github.com/enigo-rs/enigo/issues/82)