{"id":19892309,"url":"https://github.com/tio/input-emulator","last_synced_at":"2025-06-25T06:41:26.474Z","repository":{"id":41321497,"uuid":"503026261","full_name":"tio/input-emulator","owner":"tio","description":"A scriptable input emulator for Linux","archived":false,"fork":false,"pushed_at":"2025-04-05T08:40:05.000Z","size":102,"stargazers_count":31,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T09:27:22.686Z","etag":null,"topics":["automation","command-line-tool","emulator","input","keyboard","linux","mouse","multitouch","scripting","touch","uinput"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tio.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-13T16:07:12.000Z","updated_at":"2025-04-05T08:40:09.000Z","dependencies_parsed_at":"2024-05-04T13:26:44.499Z","dependency_job_id":"45bdba41-9cb0-4f6d-84c1-e9ca2fa080f8","html_url":"https://github.com/tio/input-emulator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tio%2Finput-emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tio%2Finput-emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tio%2Finput-emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tio%2Finput-emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tio","download_url":"https://codeload.github.com/tio/input-emulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252088556,"owners_count":21692815,"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":["automation","command-line-tool","emulator","input","keyboard","linux","mouse","multitouch","scripting","touch","uinput"],"created_at":"2024-11-12T18:23:00.415Z","updated_at":"2025-05-02T18:31:41.108Z","avatar_url":"https://github.com/tio.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# input-emulator - A scriptable input emulator\n\n[![](https://img.shields.io/github/v/release/tio/input-emulator?sort=semver)](https://github.com/tio/input-emulator/releases)\n[![](https://img.shields.io/codefactor/grade/github/tio/input-emulator)](https://www.codefactor.io/repository/github/tio/input-emulator)\n\n## 1. Introduction\n\nA scriptable input emulator for Linux which instructs the kernel to create\nvirtual keyboard, mouse, and touch input devices through which one can perform\nvarious high level actions (typing, movement, gestures, etc.) via command-line.\n\nSimilar actions can be performed with existing tools but they are either\nbound to X (eg. xdotool) or operates with low level events (evemu-create,\nevemu-event, etc.) which make scripted automation not as easy.\n\n### 1.1 Motivation\n\nTo make a simple input emulator for test automation.\n\ninput-emulator was originally named keyboard-simulator and started as part of\nthe [tio](https://github.com/tio/tio) project to script keyboard input to\nautomate generation of tio demonstration gifs.\n\n## 2. features\n\n * Emulates the 3 arch type input devices: keyboard, mouse, and touch\n * Perform device actions via command-line\n    * Keyboard actions: type, key, keydown, keyup\n    * Mouse actions: move, click, down, up, scroll\n    * Touch actions: tap\n * Start/stop individual input device\n * Input devices are maintained by background service (default)\n    * Allows stable input device name\n    * Status of service can be queried via command-line\n * Documented via man page\n * Supports various keyboard layouts (TODO, limited to DK for now)\n * Shell completion support (bash)\n\n## 3. Usage\n\n### 3.1 Command-line\n\nThe command-line interface is straightforward as reflected in the output from 'input-emulator --help':\n\n```\nUsage: input-emulator [--version] [--help] \u003ccommand\u003e [\u003carguments\u003e]\n\n  -v, --version                      Display version\n  -h, --help                         Display help\n\nAvailable commands:\n  start [\u003coptions\u003e] kbd|mouse|touch  Create virtual input device\n  kbd \u003caction\u003e \u003cargs\u003e                Do keyboard action\n  mouse \u003caction\u003e \u003cargs\u003e              Do mouse action\n  touch \u003caction\u003e \u003cargs\u003e              Do touch action\n  status                             Show status of virtual input devices\n  stop kbd|mouse|touch|all           Destroy virtual input device\n\nStart options:\n  -x, --x-max \u003cpoints\u003e               Maximum x-coordinate (only for mouse and touch)\n  -y, --y-max \u003cpoints\u003e               Maximum y-coordinate (only for mouse and touch)\n  -s, --slots \u003cnumber\u003e               Maximum number of slots (fingers) recognized (only for touch)\n  -d, --type-delay \u003cms\u003e              Type delay (only for keyboard, default: 15)\n  -n, --no-daemonize                 Run in foreground\n\nKeyboard actions:\n  type \u003cstring\u003e                      Type string\n  key \u003ckey\u003e                          Stroke key (press and release)\n  keydown \u003ckey\u003e                      Press key\n  keyup \u003ckey\u003e                        Release key\n\nMouse actions:\n  move \u003cx\u003e \u003cy\u003e                       Move mouse x,y relative\n  button left|middle|right           Click mouse button (press and release)\n  buttondown left|middle|right       Press mouse button\n  buttonup left|middle|right         Release mouse button\n  scroll \u003cticks\u003e                     Scroll mouse wheel number of ticks\n\nTouch actions:\n  tap \u003cx\u003e \u003cy\u003e                        Tap at x,y coordinate\n```\n\n### 3.2 Examples\n\n#### 3.2.1 Touch example\n```\n $ input-emulator start touch --x-max 2560 --y-max 1440 --slots 4\n $ input-emulator touch tap 1280 720\n $ input-emulator stop touch\n```\n#### 3.2.2 Mouse example\n```\n $ input-emulator start mouse --x-max 2560 --y-max 1440\n $ input-emulator mouse move 200 -300\n $ input-emulator mouse button left\n $ input-emulator mouse buttondown right\n $ input-emulator mouse buttonup right\n $ input-emulator mouse scroll -1\n $ input-emulator stop\n```\n#### 3.2.3 Keyboard example\n```\n $ input-emulator start kbd\n $ input-emulator kbd type 'hello there'\n $ input-emulator kbd keydown ctrl\n $ input-emulator kbd key t\n $ input-emulator kbd keyup ctrl\n $ input-emulator kbd key q\n $ input-emulator stop kbd\n```\n#### 3.2.4 Status example\n```\n $ input-emulator status\nOnline devices:\n  kbd: /sys/devices/virtual/input/input115\nmouse: /sys/devices/virtual/input/input113 (x-max: 1024 y-max: 768)\ntouch: /sys/devices/virtual/input/input114 (x-max: 1024 y-max: 768 slots: 4)\n```\n\n## 4. Installation\n\n### Prerequisite\n\nFor the input-emulator to be able to create emulated input devices the Linux\nkernel feature INPUT_UINPUT must be enabled (see drivers/input/misc/Kconfig in\nthe Linux kernel).\n\nMost distributions have this feature enabled.\n\n### 4.1 Installation from source\nInstall steps:\n\n```\n $ meson build\n $ meson compile -C build\n $ meson install -C build\n```\n\nSee meson_options.txt for input-emulator specific build options.\n\nNote: The meson install steps may differ depending on your specific system and\nenvironment.\n\n### 4.2 Set up permissions for /dev/uinput\n\nTo run input-emulator successfully as a normal user it needs access to the dev\nuinput /dev/uinput device. This is often permission protected so to gain access\nyou can do the following:\n\nCreate an uinput group:\n```\n$ sudo groupadd -f uinput\n```\n\nAdd user to group:\n```\nusermod -a -G uinput \u003cusername\u003e\n```\n\nCreate a udev rule /etc/udev/rules.d/99-input.rules containing:\n```\nKERNEL==\"uinput\", GROUP=\"uinput\", MODE:=\"0660\"\n```\n\nThen reboot computer and your user should have rw access to /dev/uinput and\ninput-emulator should work as intended.\n\n\n## 5. Contribute\n\nFeel free to improve the implementation. It is open source and released under\nthe GPLv2 license.\n\n## 6. Sponsors\n\n * DEIF A/S\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftio%2Finput-emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftio%2Finput-emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftio%2Finput-emulator/lists"}