{"id":33937372,"url":"https://github.com/emrebicer/mouce","last_synced_at":"2026-04-09T05:32:00.020Z","repository":{"id":37029265,"uuid":"477056091","full_name":"emrebicer/mouce","owner":"emrebicer","description":"Rust library to control the mouse","archived":false,"fork":false,"pushed_at":"2025-05-17T21:26:58.000Z","size":158,"stargazers_count":52,"open_issues_count":0,"forks_count":27,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T08:30:08.412Z","etag":null,"topics":["mouse","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emrebicer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-02T13:02:02.000Z","updated_at":"2025-12-02T11:29:42.000Z","dependencies_parsed_at":"2024-04-14T16:47:24.160Z","dependency_job_id":"020fd516-3e32-45bd-8da5-a63b93215772","html_url":"https://github.com/emrebicer/mouce","commit_stats":{"total_commits":71,"total_committers":4,"mean_commits":17.75,"dds":"0.21126760563380287","last_synced_commit":"240ec45af3fcc7a881c4269bca7bfbf0cec8764a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emrebicer/mouce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrebicer%2Fmouce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrebicer%2Fmouce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrebicer%2Fmouce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrebicer%2Fmouce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrebicer","download_url":"https://codeload.github.com/emrebicer/mouce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrebicer%2Fmouce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31587792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mouse","rust"],"created_at":"2025-12-12T14:59:42.564Z","updated_at":"2026-04-09T05:32:00.012Z","avatar_url":"https://github.com/emrebicer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mouce\nMouce is a library written in Rust that aims to help simulating and listening mouse actions across different platforms.\n## Supported platforms\n- **Windows** ✅\n  - Tested on Windows 10\n  - Uses User32 system library\n- **MacOS** ✅\n  - Tested on a MacBook Pro (Retina, 13-inch, Mid 2014) with Big Sur installed on it\n  - Uses CoreGraphics and CoreFoundation frameworks\n- **Unix-like systems**\n  - **X11** ✅\n    - Tested on i3wm Arch Linux\n    - Uses X11 and XTest libraries\n  - **Others (partially supported)** ❌\n    - For other systems, you can disable the x11 feature and the library will use **uinput**\n      - Use `--no-default-features` argument with cargo\n      - Or disable default features in `Cargo.toml`\n        ```toml\n        [dependencies]\n        mouce = { version = \"x.y.z\", default-features = false }\n        ```\n    - While using **uinput** there are some limitations for the library\n      - ```get_position``` function is not implemented as **uinput** does not provide such a feature\n      - The rest of the actions work and tested on KDE Wayland and sway\n## Library interface\n```rust\n/// Move the mouse to the given `x`, `y` coordinates in logical pixel space\nfn move_to(\u0026self, x: i32, y: i32) -\u003e Result\u003c(), Error\u003e;\n/// Move the mouse relative to the current position in logical pixel space\nfn move_relative(\u0026self, x_offset: i32, y_offset: i32) -\u003e Result\u003c(), Error\u003e;\n/// Get the current position of the mouse in logical pixel space\nfn get_position(\u0026self) -\u003e Result\u003c(i32, i32), Error\u003e;\n/// Press down the given mouse button\nfn press_button(\u0026self, button: MouseButton) -\u003e Result\u003c(), Error\u003e;\n/// Release the given mouse button\nfn release_button(\u0026self, button: MouseButton) -\u003e Result\u003c(), Error\u003e;\n/// Click the given mouse button\nfn click_button(\u0026self, button: MouseButton) -\u003e Result\u003c(), Error\u003e;\n/// Scroll the mouse wheel towards to the given direction\nfn scroll_wheel(\u0026self, direction: ScrollDirection, scroll_unit: ScrollUnit, distance: u32) -\u003e Result\u003c(), Error\u003e;\n/// Attach a callback function to mouse events\nfn hook(\u0026mut self, callback: Box\u003cdyn Fn(\u0026MouseEvent) + Send\u003e) -\u003e Result\u003cCallbackId, Error\u003e;\n/// Remove the callback function with the given `CallbackId`\nfn unhook(\u0026mut self, callback_id: CallbackId) -\u003e Result\u003c(), Error\u003e;\n/// Remove all callback functions\nfn unhook_all(\u0026mut self) -\u003e Result\u003c(), Error\u003e;\n```\n## Example\nThis example program moves the mouse from left to right;\n```rust\nuse std::thread;\nuse std::time::Duration;\n\nuse mouce::{Mouse, MouseActions};\n\nfn main() {\n    let mouse_manager = Mouse::new();\n\n    let mut x = 0;\n    while x \u003c 1920 {\n        let _ = mouse_manager.move_to(x, 540);\n        x += 1;\n        thread::sleep(Duration::from_millis(2));\n    }\n}\n```\nTo see more examples, you can look at the documentation by running;\n```fish\ncargo doc --open\n```\n## CLI binary\nmouce comes with an example CLI program that uses mouce library functions.\nYou can install the binary with;\n```fish\ncargo install mouce --features=\"cli\"\n```\nand see ```mouce --help``` for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrebicer%2Fmouce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrebicer%2Fmouce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrebicer%2Fmouce/lists"}