{"id":29928809,"url":"https://github.com/clemenscodes/joymouse-rs","last_synced_at":"2025-10-20T00:45:25.388Z","repository":{"id":302030039,"uuid":"1009816348","full_name":"clemenscodes/joymouse-rs","owner":"clemenscodes","description":"JoyMouse emulates a virtual game controller and maps relative mouse movement to the right analog stick","archived":false,"fork":false,"pushed_at":"2025-07-26T09:35:52.000Z","size":5926,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-26T15:40:15.835Z","etag":null,"topics":["gamepad-controller","rust","virtual-devices"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clemenscodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-06-27T19:02:45.000Z","updated_at":"2025-07-26T09:35:56.000Z","dependencies_parsed_at":"2025-06-30T07:47:15.832Z","dependency_job_id":"9acc7222-33fc-47ac-a417-0fbe271c6e5a","html_url":"https://github.com/clemenscodes/joymouse-rs","commit_stats":null,"previous_names":["clemenscodes/joymouse-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/clemenscodes/joymouse-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemenscodes%2Fjoymouse-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemenscodes%2Fjoymouse-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemenscodes%2Fjoymouse-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemenscodes%2Fjoymouse-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clemenscodes","download_url":"https://codeload.github.com/clemenscodes/joymouse-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemenscodes%2Fjoymouse-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268401594,"owners_count":24244464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["gamepad-controller","rust","virtual-devices"],"created_at":"2025-08-02T14:11:23.727Z","updated_at":"2025-10-20T00:45:25.357Z","avatar_url":"https://github.com/clemenscodes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JoyMouse 🎮🐭\n\n_Turn your mouse into a virtual gamepad!_\n\n**JoyMouse** is a lightweight, cross-platform input daemon\nthat emulates a virtual game controller, mapping mouse movement to analog stick input.\nIdeal for emulators like [RPCS3](https://rpcs3.net/),\nparticularly in first-person shooters\nor camera-driven games where mouse precision is key.\n\n---\n\n## ✨ Features\n\n- 🖱️ **Mouse → Right Analog Stick** mapping\n- 🎮 **Virtual Controller Emulation**\n  - **Linux:** Uses `evdev` for input parsing and `uinput` to create a virtual controller\n  - **Windows:** Uses `device query` for input and [`ViGEmClient`](https://github.com/ViGEm/ViGEmClient) + [ViGEmBus](https://github.com/ViGEm/ViGEmBus) for virtual gamepad creation\n- ⚙️ **Customizable Settings**\n- 🧭 Auto recenter analog stick after idle\n- 🐧 **Linux support** (fully functional)\n- 💻 **Windows support** (in progress)\n- 🔒 Built with **modern Rust** (≥1.87.0)\n\n---\n\n## 🖥️ How It Works\n\n- **Linux:**\n\n  - Reads input events using [`evdev`](https://www.freedesktop.org/wiki/Software/libevdev/)\n  - Creates a virtual device via [`uinput`](https://www.kernel.org/doc/html/latest/input/uinput.html)\n  - Emits events as if from a real controller\n\n- **Windows:**\n  - Parses events using device APIs\n  - Emulates a virtual controller using [`ViGEmClient`](https://github.com/ViGEm/ViGEmClient)\n    and [`ViGEmBus`](https://github.com/ViGEm/ViGEmBus)\n\n---\n\n## 🏗 Architecture\n\n```text\n+---------------------+\n|    JoyMouse App     |\n+---------------------+\n          |\n          v\n+---------------------------+\n|  PlatformControllerManager|\n|  (Cross-platform logic)   |\n+---------------------------+\n          |\n          v\n+-------------------------------+\n| VirtualController             |\n| - left stick / right stick    |\n| - handle events               |\n| - emit events                 |\n+-------------------------------+\n          |\n          v\n+-------------------------+\n| PlatformControllerOps   |\n| (OS-specific backend)   |\n|                         |\n| LinuxOps:               |\n|  - evdev (Input Read)   |\n|  - uinput (Virtual Pad) |\n|                         |\n| WindowsOps (WIP):       |\n|  - Device API (Input)   |\n|  - ViGEmClient + Bus    |\n+-------------------------+\n```\n\n---\n\n## 📸 Demo (Coming Soon)\n\n\u003e ![Demo GIF](./assets/demo.gif)\n\n---\n\n## 🚀 Getting Started\n\n### 🔽 Downloads\n\nThe latest releases can be downloaded from the [Downloads section](https://github.com/clemenscodes/joymouse-rs/releases/tag/latest).\n\nFor Windows, you can directly download the binary here:  \n[joymouse.exe](https://github.com/clemenscodes/joymouse-rs/releases/download/latest/joymouse.exe)\nTo create the virtual controller, installing the ViGEmBus Driver is required. You can download the driver [here](https://github.com/nefarius/ViGEmBus/releases/download/v1.22.0/ViGEmBus_1.22.0_x64_x86_arm64.exe).\nJust double click the executable file. It should open a window that says that JoyMouse started.\n\nFor Linux, you can directly download the binary here:  \n[joymouse](https://github.com/clemenscodes/joymouse-rs/releases/download/latest/joymouse-musl-static)\nFor a seemless experience, it is recommended to add your user to the `input` group. This allows reading `/dev/input` without needing `sudo` and thus running the binary without `sudo`.\nTo add your user to the `input` group, run the following command `sudo usermod -a -G input $USER`.\nThen simply run the downloaded binary in the terminal.\n\n### 🛠️ Build Instructions\n\n```bash\ngit clone https://github.com/clemenscodes/joymouse.git\ncd joymouse\ncargo build --release\n```\n\n---\n\n## ⚙️ Configuration\n\nJoyMouse uses two TOML configuration files located in your OS-specific configuration directory:\n\n- **Linux:** `~/.config/joymouse/`\n- **Windows:** `%APPDATA%\\joymouse\\`\n\n### **1. joymouse.toml** – Mouse \u0026 Stick Settings\n\nThis file defines settings for right analog stick emulation and tuning.\n\n```toml\ntickrate = 16\nmouse_idle_timeout = 64\nmax_tilt_range = 32767.0\nmin_tilt_range = 13107.0\nsensitivity = 7.0\nblend = 0.2\ndiagonal_boost = 1.41\nangle_delta_limit = 0.5\nspeed_stabilize_threshold = 200.0\nmin_speed_clamp = 1.0\nmax_speed_clamp = 500.0\nmotion_threshold_micro_macro = 0.025\nmotion_threshold_macro_flick = 0.5\nmotion_threshold_macro_micro = 0.03\nmotion_threshold_micro_macro_recover = 0.01\n```\n\n#### **Key Settings**\n\n| Setting                                | Description                                               |\n| -------------------------------------- | --------------------------------------------------------- |\n| `tickrate`                             | Update interval in milliseconds (lower = faster response) |\n| `mouse_idle_timeout`                   | Time in ms before the stick auto-centers when idle        |\n| `max_tilt_range`                       | Maximum analog stick tilt value                           |\n| `min_tilt_range`                       | Minimum analog stick tilt value (deadzone)                |\n| `sensitivity`                          | Mouse-to-stick sensitivity multiplier                     |\n| `blend`                                | Smoothing factor between micro and macro movement         |\n| `diagonal_boost`                       | Multiplier for diagonal movement                          |\n| `angle_delta_limit`                    | Max allowed angle change per update                       |\n| `speed_stabilize_threshold`            | Speed where input stabilizes                              |\n| `min_speed_clamp`                      | Minimum clamped speed                                     |\n| `max_speed_clamp`                      | Maximum clamped speed                                     |\n| `motion_threshold_micro_macro`         | Threshold to switch micro → macro motion                  |\n| `motion_threshold_macro_flick`         | Threshold for fast flick detection                        |\n| `motion_threshold_macro_micro`         | Threshold to switch macro → micro motion                  |\n| `motion_threshold_micro_macro_recover` | Threshold to recover from macro to micro                  |\n\n### **2. bindings.toml** – Button Mappings\n\nThis file defines which keyboard keys or mouse buttons map to virtual controller buttons.\n\n```toml\nsouth = [\"space\"]\neast = [\"left_ctrl\"]\nnorth = [\"f\"]\nwest = [\"c\", \"mouse_side\"]\n\nup = [\"up\", \"k\", \"2\"]\ndown = [\"down\", \"j\", \"4\"]\nleft = [\"left\", \"h\", \"1\"]\nright = [\"right\", \"l\", \"3\"]\n\nforward = [\"w\"]\nbackward = [\"s\"]\nstarboard = [\"d\"]\nport = [\"a\"]\n\nl1 = [\"mouse_right\"]\nr1 = [\"mouse_left\"]\nl2 = [\"q\", \"mouse_extra\"]\nr2 = [\"x\"]\n\nl3 = [\"left_alt\"]\nr3 = [\"v\"]\n\nstart = [\"enter\"]\nselect = [\"tab\"]\n```\n\n#### **Supported Actions**\n\n| Action                                     | Description            |\n| ------------------------------------------ | ---------------------- |\n| `south`, `east`, `north`, `west`           | Face buttons (A/B/X/Y) |\n| `up`, `down`, `left`, `right`              | D-Pad directions       |\n| `forward`, `backward`, `starboard`, `port` | Movement keys          |\n| `l1`, `r1`                                 | Shoulder buttons       |\n| `l2`, `r2`                                 | Triggers               |\n| `l3`, `r3`                                 | Stick click buttons    |\n| `start`, `select`                          | Menu buttons           |\n\n### **Key Notes**\n\n- Multiple keys can be bound to the same action by listing them in an array.\n- Supported input names:\n  - **Keyboard keys**: `a`, `space`, `enter`, `tab`, `up`, `down`, etc.\n  - **Mouse buttons**: `mouse_left`, `mouse_right`, `mouse_side`, `mouse_extra`.\n\n## Contributing\n\nContributions are welcome!\nPlease have a look at the [issues](https://github.com/clemenscodes/joymouse-rs/issues)\nto see what currently needs help\nor what features are planned and just pick what you like.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclemenscodes%2Fjoymouse-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclemenscodes%2Fjoymouse-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclemenscodes%2Fjoymouse-rs/lists"}