{"id":16250900,"url":"https://github.com/jingwood/js-input-control","last_synced_at":"2025-03-19T19:32:19.532Z","repository":{"id":42928014,"uuid":"236984729","full_name":"jingwood/js-input-control","owner":"jingwood","description":"A lightweight library to handle the mouse, keyboard and touch control from end-user.","archived":false,"fork":false,"pushed_at":"2024-05-16T15:18:46.000Z","size":368,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T20:40:57.637Z","etag":null,"topics":["input","input-control","keyboard","mouse","touches","touchscreen","ui"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jingwood.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":"2020-01-29T13:10:00.000Z","updated_at":"2025-02-24T20:59:39.000Z","dependencies_parsed_at":"2024-10-27T21:30:06.273Z","dependency_job_id":"44e9f9d1-3c81-425a-ac85-d7a06e97e549","html_url":"https://github.com/jingwood/js-input-control","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.18867924528301883","last_synced_commit":"03a4007320b696b079331f6cb4264d08964421f5"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingwood%2Fjs-input-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingwood%2Fjs-input-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingwood%2Fjs-input-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jingwood%2Fjs-input-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jingwood","download_url":"https://codeload.github.com/jingwood/js-input-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014113,"owners_count":20383716,"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","input-control","keyboard","mouse","touches","touchscreen","ui"],"created_at":"2024-10-10T15:07:31.720Z","updated_at":"2025-03-19T19:32:19.240Z","avatar_url":"https://github.com/jingwood.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# @jingwood/input-control\n\nA lightweight Javascript library used to handle the input events of mouse, keyboard and touch control from end-user.\n\n# Features\n\n- Event registeriton and dispatching\n- Receives and dispatches mouse, keyboard and touch events\n- Provides and dispatches dragging events based on mouse and touch events\n- Provides functions to check whether specified key is pressed\n- Provides hotkey define feature (todo)\n\n# Installation\n\n```shell\nyarn add @jingwood/input-control\n```\n\n# Hello-World\n\n```js\n\n// get the element to receive mouse, keyboard and touch events\nconst element = document.getElementById(myTargetElement);\n\n// make sure the element can receive keyboard events\nelement.tabIndex = 0;\nelement.focus();\n\n// create controller and use 'on' method to receive input events\nconst controller = new InputController(element);\n\n// keyup event\ncontroller.on(\"keyup\" e =\u003e {\n  if (e.keyCode === 32) {\n    alert(\"Space key was pressed\");\n  }\n});\n\n// drag event\ncontroller.on(\"drag\", e =\u003e {\n  console.log(\"mouse moving \" + e.movement.x + \", \" + e.movement.y);\n});\n```\n\n# License\n\nReleased under MIT License\n\nCopyright (C) 2015-2020 Jingwood, unvell.com, all rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingwood%2Fjs-input-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingwood%2Fjs-input-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingwood%2Fjs-input-control/lists"}