{"id":25063758,"url":"https://github.com/games-on-whales/inputtino","last_synced_at":"2025-04-07T12:03:51.909Z","repository":{"id":221755486,"uuid":"752715975","full_name":"games-on-whales/inputtino","owner":"games-on-whales","description":"A virtual input library: supports mouse, keyboard, joypad, trackpad and more","archived":false,"fork":false,"pushed_at":"2025-03-24T20:15:29.000Z","size":409,"stargazers_count":36,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"stable","last_synced_at":"2025-04-01T15:16:14.426Z","etag":null,"topics":["cpp","evdev","joypad","keyboard","linux","mouse","rest-api","uinput","virtual-input"],"latest_commit_sha":null,"homepage":"","language":"C++","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/games-on-whales.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}},"created_at":"2024-02-04T16:00:42.000Z","updated_at":"2025-03-24T20:15:30.000Z","dependencies_parsed_at":"2024-10-18T18:58:33.518Z","dependency_job_id":"b36baeb3-be73-4dd4-b89b-fe51b2f7eae6","html_url":"https://github.com/games-on-whales/inputtino","commit_stats":{"total_commits":53,"total_committers":5,"mean_commits":10.6,"dds":"0.13207547169811318","last_synced_commit":"5d4b8b23f036eee7b36854523f8b41af6b33667e"},"previous_names":["games-on-whales/inputtino"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/games-on-whales%2Finputtino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/games-on-whales%2Finputtino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/games-on-whales%2Finputtino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/games-on-whales%2Finputtino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/games-on-whales","download_url":"https://codeload.github.com/games-on-whales/inputtino/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569920,"owners_count":20959898,"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","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":["cpp","evdev","joypad","keyboard","linux","mouse","rest-api","uinput","virtual-input"],"created_at":"2025-02-06T18:45:27.499Z","updated_at":"2025-04-07T12:03:51.885Z","avatar_url":"https://github.com/games-on-whales.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inputtino\n\nAn easy to use virtual input library for Linux built on top of `uinput`, `evdev` and `uhid`.  \nCurrently in use by [Wolf](https://github.com/games-on-whales/wolf), [Sunshine](https://github.com/LizardByte/Sunshine) and [Moonshine](https://github.com/hgaiser/moonshine)\n\nSupports:\n\n- Keyboard\n- Mouse\n- Touchscreen\n- Trackpad\n- Pen tablet\n- Joypad\n    - Correctly emulates Xbox, PS5 or Nintendo joypads\n    - Supports callbacks on Rumble events\n    - Gyro, Acceleration, Touchpad, Adaptive triggers, LED and battery status fully supported when creating a virtual DualSense joypad (with full support without Steam Input for games that are compatible with DualSense)\n\nInterested in how the joypad works under the hood? Checkout these blog posts:\n- [When uinput Isn’t Enough: Virtualizing a DualSense controller](https://abeltra.me/blog/inputtino-uhid-1/)\n- [Creating a Virtual DualSense Controller via UHID](https://abeltra.me/blog/inputtino-uhid-2/)\n- [Beyond USB: Improving Virtual Controller Support in Linux Games](https://abeltra.me/blog/inputtino-uhid-3/)\n\nA special thanks goes to [@hgaiser](https://github.com/hgaiser) for all the help in yak shaving the DualSense implementation.\n\n## Include in a C++ project\n\nIf using `Cmake` it's as simple as\n\n```cmake\nFetchContent_Declare(\n        inputtino\n        GIT_REPOSITORY https://github.com/games-on-whales/inputtino.git\n        GIT_TAG \u003cGIT_SHA_OR_TAG\u003e)\nFetchContent_MakeAvailable(inputtino)\ntarget_link_libraries(\u003cyour_project_name\u003e PUBLIC inputtino::libinputtino)\n```\n\n### Example usage\n\n```c++\n#include \u003cinputtino/input.hpp\u003e\n\nauto joypad = Joypad::create(Joypad::PS, Joypad::RUMBLE | Joypad::ANALOG_TRIGGERS);\n\njoypad-\u003eset_stick(Joypad::LS, 1000, 2000);\njoypad-\u003eset_pressed_buttons(Joypad::X | Joypad::DPAD_RIGHT);\n\nauto rumble_data = std::make_shared\u003cstd::pair\u003cint, int\u003e\u003e();\njoypad.set_on_rumble([rumble_data](int low_freq, int high_freq) {\n    rumble_data-\u003efirst = low_freq;\n    rumble_data-\u003esecond = high_freq;\n});\n```\n\nFor more examples you can look at the unit tests under `tests/`: Joypads have been tested using `SDL2` other input\ndevices have been tested with `libinput`.\n\nThe main interface is easily accessible\nunder [include/inputtino/input.hpp](include/inputtino/input.hpp)\n\n## Using the Python bindings\n\nCheckout the instructions in [bindings/python/](bindings/python/); example usage:\n\n```python\nfrom inputtino import Mouse, MouseButton\n\n# Initialize mouse device\nmouse = Mouse()\n\n# Move mouse\nmouse.move(100, 50)  # Move right 100, down 50\nmouse.move_abs(500, 300, 1920, 1080)  # Move to absolute position\n\n# Click operations\nmouse.click(MouseButton.LEFT)\nmouse.click(MouseButton.RIGHT, duration=0.5)  # Hold for 0.5 seconds\n\n# Scrolling\nmouse.scroll_vertical(120)  # Scroll up\nmouse.scroll_horizontal(-120)  # Scroll left\n```\n\n## Using the Rust bindings\n\nAfter building and installing `inputtino` you can use the Rust bindings by adding the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\ninputtino = { git = \"https://github.com/games-on-whales/inputtino.git\", branch=\"stable\" }\n```\n\nExample usage:\n\n```rust\nlet device = DeviceDefinition::new(\n        \"Rusty Keyboard\",\n        0xAB,\n        0xCD,\n        0xEF,\n        \"Rusty Keyboard Phys\",\n        \"Rusty Keyboard Uniq\",\n    );\nlet keyboard = Keyboard::new(\u0026device).unwrap();\n\nkeyboard.press_key(0x41); // KEY_A\nkeyboard.release_key(0x41);\n```\n\nSee the [tests](bindings/rust/inputtino/tests) for more examples.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgames-on-whales%2Finputtino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgames-on-whales%2Finputtino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgames-on-whales%2Finputtino/lists"}