{"id":22562187,"url":"https://github.com/max1220/lua-input","last_synced_at":"2025-04-10T10:32:55.732Z","repository":{"id":101936925,"uuid":"85698195","full_name":"max1220/lua-input","owner":"max1220","description":"Lua bindings to /dev/input/event* for non-blocking event reading","archived":false,"fork":false,"pushed_at":"2024-07-19T14:21:05.000Z","size":66,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:21:17.730Z","etag":null,"topics":["input","library","linux","lua","uinput"],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/max1220.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}},"created_at":"2017-03-21T12:17:39.000Z","updated_at":"2024-12-01T21:41:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ad084f0-e45a-4923-a80e-39440c5781b9","html_url":"https://github.com/max1220/lua-input","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flua-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flua-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flua-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flua-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/max1220","download_url":"https://codeload.github.com/max1220/lua-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"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":["input","library","linux","lua","uinput"],"created_at":"2024-12-07T22:12:01.102Z","updated_at":"2025-04-10T10:32:55.702Z","avatar_url":"https://github.com/max1220.png","language":"Lua","readme":"# lua-input\n\nLibrary for using the Linux input/uinput subsystem to read input events\nor create input devices and events.\n\nThis allows reading keyboard/mouse/touchscreen events,\nand emulating input devices for all other applications on the system.\n\nCompatible with Lua5.1, LuaJIT, Lua5.2, Lua5.3, Lua5.4.\n\n\n\n\n\n# Installation\n\nSee [doc/INSTALLATION.md](doc/INSTALLATION.md)\n\nThis library is packaged and build using Luarocks, which makes building\nand installing easy.\n\n```\ngit clone https://github.com/max1220/lua-input\ncd lua-input\n# install locally, usually to ~/.luarocks\nluarocks make --local\n```\n\nWhen installing locally you need to tell Lua where to look for modules\ninstalled using Luarocks, e.g.:\n\n```\nluarocks path \u003e\u003e ~/.bashrc\n```\n\nYou can also install the library manually, see documentation.\n\nSome of the examples also require my simple [time library](https://github.com/max1220/lua-time).\n\n\n## Device permissions\n\nBecause this library might read/write access to the `/dev/input/*` or `/dev/uinput`\nspecial files, you need to make sure your user has the correct permissions.\nThe `/dev/input/event*` files are typically owned by the `input` group, so\n`adduser \u003cyour username\u003e input` should be enough to give you access.\nFor security reasons, the `/dev/uinput` device is owned `root:root`, since it\ncan add virtual input devices to the computer that are \nidentified as regular system input devices.\nIf your usecase requires access to this functionallity, I recommend creating a\nseparate user or group for access to `/dev/uinput`.\nYou never should `chmod` the files in `/dev/`.\n\n\n## Library usage\n\nFull usage see [doc/USAGE.md](doc/USAGE.md)\n\n### Reading events from a device\n\n```\nlocal input = require(\"lua-input\")\n\n-- read events from a device\nlocal input_dev = input.open_input(\"/dev/input/event0\")\nwhile true do\n\tlocal ev = input_dev:read_event()\n\tprint(\"event\",ev.type, ev.code, ev.value)\nend\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax1220%2Flua-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax1220%2Flua-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax1220%2Flua-input/lists"}