{"id":31194823,"url":"https://github.com/kelexine/hid-gadget-module","last_synced_at":"2025-12-24T05:26:29.276Z","repository":{"id":290176680,"uuid":"969151182","full_name":"kelexine/hid-gadget-module","owner":"kelexine","description":"A magisk Module for enabling Human Interface Device (HID) emulation/support on Android Devices ","archived":false,"fork":false,"pushed_at":"2025-05-13T22:36:02.000Z","size":189,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T00:11:46.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","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/kelexine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-19T14:01:43.000Z","updated_at":"2025-05-13T22:36:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"aab03182-7ccd-49a2-8ae2-3732665e1d5d","html_url":"https://github.com/kelexine/hid-gadget-module","commit_stats":null,"previous_names":["kelexine/hid-gadget-module"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kelexine/hid-gadget-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelexine%2Fhid-gadget-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelexine%2Fhid-gadget-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelexine%2Fhid-gadget-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelexine%2Fhid-gadget-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kelexine","download_url":"https://codeload.github.com/kelexine/hid-gadget-module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelexine%2Fhid-gadget-module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276033070,"owners_count":25573474,"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-09-20T02:00:10.207Z","response_time":63,"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":[],"created_at":"2025-09-20T02:02:26.171Z","updated_at":"2025-09-20T02:04:58.621Z","avatar_url":"https://github.com/kelexine.png","language":"HTML","funding_links":[],"categories":["🎮 Hardware and Sensors"],"sub_categories":["Input Devices and Controllers"],"readme":"# HID Gadget Module for Magisk\n\nThis Magisk module provides USB HID (Human Interface Device) gadget functionality for Android devices. It allows your device to act as a USB keyboard, mouse, or consumer control device when connected to a computer.\n\n## Features\n\n### Keyboard Emulation\n- Full keyboard support with standard layout, function keys (F1-F12), and modifiers (Ctrl, Alt, Shift, GUI/Meta)\n- Special keys: Enter, Escape, Tab, media keys, etc.\n- Key combination support\n\n### Mouse Emulation\n- Relative motion control\n- Button clicks (left, middle, right)\n- Double-click functionality\n- Press-and-hold actions\n- Vertical and horizontal scrolling\n- Smooth movements with variable speeds\n\n### Consumer Control\n- Media playback controls (Play, Pause, Stop)\n- Volume controls (Up, Down, Mute)\n- Media navigation (Next, Previous, Forward, Rewind)\n- Brightness controls\n\n## Installation\n\n1. Download the latest release ZIP from the [Releases page](https://github.com/kelexine/hid-gadget-module/releases)\n2. Install through Magisk Manager:\n   - Open Magisk Manager\n   - Tap on Modules\n   - Tap \"Install from storage\"\n   - Select the downloaded ZIP file\n   - Reboot your device after installation\n\n### Requirements\n\n- Magisk v20.4 or newer\n- A device with USB OTG support and kernel configfs support\n- Root access\n\n## Usage\n\nThe tool automatically discovers and uses available HID gadget devices (`/dev/hidgX`). It dynamically identifies and assigns the first three HID gadget devices it finds:\n- First device: Keyboard\n- Second device: Mouse\n- Third device: Consumer controls\n\nThis means you don't need to worry about specific device nodes - the tool handles this automatically.\n\n### Keyboard Commands\n\nThe `hid-keyboard` tool lets you send keyboard events:\n\n```bash\n# Type text\nhid-keyboard \"Hello World\"\n\n# Press special keys\nhid-keyboard F5\nhid-keyboard ENTER\nhid-keyboard ESC\n\n# Use modifiers\nhid-keyboard CTRL-ALT-DELETE\nhid-keyboard CTRL-C\nhid-keyboard ALT-TAB\n\n# Press and hold keys\nhid-keyboard --hold ALT\nhid-keyboard TAB\nhid-keyboard --release\n\n# Complex combinations\nhid-keyboard CTRL-ALT-F4\n```\n\n### Mouse Commands\n\nThe `hid-mouse` tool provides mouse control:\n\n```bash\n# Move the cursor (relative coordinates)\nhid-mouse move 10 0    # Move right\nhid-mouse move 0 -10   # Move up\nhid-mouse move -5 5    # Move left and down\n\n# Click buttons\nhid-mouse click        # Left click (default)\nhid-mouse click right  # Right click\nhid-mouse click middle # Middle click\n\n# Double-click\nhid-mouse doubleclick\n\n# Press and hold\nhid-mouse down         # Press and hold left button\nhid-mouse move 20 20   # Drag while holding\nhid-mouse up           # Release button\n\n# Scrolling\n# Vertical scrolling works with the default descriptor\nhid-mouse scroll 0 5   # Scroll down 5 units\nhid-mouse scroll 0 -5  # Scroll up 5 units\n# Horizontal scrolling depends on your HID descriptor (not enabled by default)\n# hid-mouse scroll 5 0   # Horizontal scroll requires a 5-byte mouse report descriptor\n```\n\n### Consumer Control Commands\n\nThe `hid-consumer` tool controls media and related functions:\n\n```bash\n# Media playback\nhid-consumer PLAY\nhid-consumer PAUSE\nhid-consumer STOP\nhid-consumer NEXT\nhid-consumer PREVIOUS\n\n# Volume control\nhid-consumer VOL+\nhid-consumer VOL-\nhid-consumer MUTE\n\n# Other controls\nhid-consumer BRIGHTNESS+\nhid-consumer BRIGHTNESS-\n```\n\n## Troubleshooting\n\n### Device Not Detected as HID\n\n1. Make sure USB debugging is disabled\n2. Try different USB cables\n3. Check that your kernel supports USB configfs\n4. Reboot your device\n5. Check logs with `logcat | grep hidg`\n\n### HID Device Detection and Overrides\n\nIf automatic device detection isn't working or your device nodes are non-standard, you can override them via environment variables:\n\n```bash\nexport HID_KEYBOARD_DEV=/dev/hidg3\nexport HID_MOUSE_DEV=/dev/hidg1\nexport HID_CONSUMER_DEV=/dev/hidg2\n```\n\nCommands work with any available subset of devices. For a quick usage overview:\n\n```bash\nhid-mouse --help\nhid-keyboard --help\nhid-consumer --help\n```\n\n### Permission Issues\n\nIf you encounter permission errors when using the commands:\n\n```bash\n# Find which hidg devices are being used\nhid-keyboard\n# Fix permissions manually based on the output\nsu -c chmod 666 /dev/hidg*\n```\n\n### Commands Not Working\n\n1. Make sure your device is connected to a host computer\n2. Verify the module is properly installed and enabled in Magisk Manager\n3. Some functions may not be supported by all host computers\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgements\n\n- The Magisk development team\n- Linux kernel USB gadget documentation\n- All contributors and testers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelexine%2Fhid-gadget-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkelexine%2Fhid-gadget-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelexine%2Fhid-gadget-module/lists"}