{"id":21682199,"url":"https://github.com/ynezz/luaevdev","last_synced_at":"2026-01-07T20:09:54.650Z","repository":{"id":3371024,"uuid":"4418017","full_name":"ynezz/luaevdev","owner":"ynezz","description":"Lua library for comfortable access to Linux input subsystem(evdev particularly)","archived":false,"fork":false,"pushed_at":"2019-01-27T20:22:36.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T23:31:42.115Z","etag":null,"topics":["c","evdev","linux","lua"],"latest_commit_sha":null,"homepage":"","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/ynezz.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}},"created_at":"2012-05-23T09:00:34.000Z","updated_at":"2021-07-13T04:08:02.000Z","dependencies_parsed_at":"2022-09-01T08:11:40.790Z","dependency_job_id":null,"html_url":"https://github.com/ynezz/luaevdev","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynezz%2Fluaevdev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynezz%2Fluaevdev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynezz%2Fluaevdev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynezz%2Fluaevdev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ynezz","download_url":"https://codeload.github.com/ynezz/luaevdev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162115,"owners_count":20733355,"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":["c","evdev","linux","lua"],"created_at":"2024-11-25T15:34:03.996Z","updated_at":"2026-01-07T20:09:49.621Z","avatar_url":"https://github.com/ynezz.png","language":"Lua","readme":"# luaevdev\n\nSmall library for comfortable access to Linux input subsystem(evdev particularly) from Lua.\n\n## About\n\nI've created this small library, because I somehow needed to process(and sometimes also modify) output of\nbarcode reader, which was connected to the system as USB/HID keyboard.\n\nSo according to this use case my aim wasn't to create fullblown library from day one, but instead\nI've added everything necessary for my needs, particularly handling just of the key events. Anyway\nI think, that it's generic enough to add support for other event types, so as always, patches are welcome :)\n\n## Build instructions\n\n1. `$ git://github.com/ynezz/luaevdev.git`\n1. `$ cd luavdev`\n1. `$ mkdir build \u0026\u0026 cd build`\n1. `$ cmake ..` or `cmake-gui ..`\n1. `$ cmake --build .`\n1. `$ sudo cmake --build . --target install`\n\n## Usage\n\n`$ cat test.lua`\n\n``` lua\nrequire(\"evdev\")\n\nfunction pretty_white(s)\n  return s:gsub('\\r', '\\\\r'):gsub('\\n', '\\\\n'):gsub('\\t', '\\\\t')\nend\n\nfunction log(...) io.stdout:write(string.format(...), '\\n') end\n\nfunction read_test(device, debug)\n\tlocal p, e, r\n\n\tlocal p, e  = evdev.new()\n\tif e then log(\"evdev create error: %s\", e) return end\n\n\tp:set_log_function(log)\n\tp:set_debug(debug)\n\tr, e = p:open(device)\n\tif e then log(\"open() barcode reader error: %s\", e) return end\n\n\trepeat\n\t\tlog(\"Please scan a barcode...\")\n\t\tr, e = p:read_keys_until('KEY_ENTER')\n\t\tlog(\"Read barcode: %s\", pretty_white(r or 'nothing'))\n\tuntil e\n\n\tlog(\"Barcode read error: %s\", e)\n\tp:close()\nend\n\nread_test({ vendor=0x76d, product=0x1 })  -- Toyota Denso GT-10 (barcode reader)\n```\n\n## License\n\nCopyright \u0026copy; 2019 Petr Štetiar, Gaben spol. s r.o.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynezz%2Fluaevdev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fynezz%2Fluaevdev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynezz%2Fluaevdev/lists"}