{"id":15104149,"url":"https://github.com/nicolas-sabbatini/simplekey","last_synced_at":"2025-09-27T02:32:22.012Z","repository":{"id":112168203,"uuid":"107557312","full_name":"nicolas-sabbatini/simpleKey","owner":"nicolas-sabbatini","description":"A simple yet awesome input library for love2d","archived":true,"fork":false,"pushed_at":"2024-02-14T02:16:49.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-09-26T20:02:51.623Z","etag":null,"topics":["love-game-engine","love2d","love2d-framework","lua","lua-library"],"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/nicolas-sabbatini.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":"2017-10-19T14:28:08.000Z","updated_at":"2024-02-14T02:17:46.000Z","dependencies_parsed_at":"2024-02-14T03:33:15.394Z","dependency_job_id":null,"html_url":"https://github.com/nicolas-sabbatini/simpleKey","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.1333333333333333,"last_synced_commit":"1b484bb989a2732270adb15d13d3f2e5fd066083"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolas-sabbatini%2FsimpleKey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolas-sabbatini%2FsimpleKey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolas-sabbatini%2FsimpleKey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolas-sabbatini%2FsimpleKey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolas-sabbatini","download_url":"https://codeload.github.com/nicolas-sabbatini/simpleKey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234376916,"owners_count":18822416,"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":["love-game-engine","love2d","love2d-framework","lua","lua-library"],"created_at":"2024-09-25T20:00:39.091Z","updated_at":"2025-09-27T02:32:16.768Z","avatar_url":"https://github.com/nicolas-sabbatini.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Key\n\n## WARNING\n\nThis library is deprecated, I recommend you to use the simple keyboard library instead.\n\nThe simple keyboard library can be found [here](https://github.com/nicolas-sabbatini/lovely-tools).\n\n## Description\n\nSimple Key is a simple yet awesome input library for Love2d.\nThe objective of this library is to make the keyboard input handle easy in a small and\ncompact way, the module don't change the _love.keypressed(key)_ so you can have\nmultiple instances running without collisions.\n\nThe library is aimed to be used in small projects.\n\n## Motivations\n\nThere is a lot of input libraries for Love2d, but all of them are big and complex, and\nit can be a little over kill use a library that can handel joystick and touch screen\nfor a small project, so I made this.\n\n## Usage\n\n```lua\nlocal key = require('simpleKey')\nlocal keyInstance = key:createInstance({'space'})\n\nfunction love.update(dt)\n    keyInstance:updateInput()\n    if keyInstance:isDown('space') then print('space dawn') end\n    if keyInstance:justReleased('space') then print('space got released') end\n    if keyInstance:justPressed('space') then print('space is jusr pressed') end\nend\n```\n\n## API\n\n```lua\n-- Create a new instance of simpleKey.\n-- @_param_ `keys` (string or table) — The keys to bind.\n-- @_return_ `instance` — The new instance of simpleKey.\nsimpleKey:createInstance(keys)\n```\n\n```lua\n-- Check if a key is dawn, this key don't need to be bound.\n-- This function is a wrapper for _love.keyboard.isDown(key)_.\n-- @_param_ `key` — The key to check.\n-- @_return_ `down` — True if the key is down, false if not.\ninstance:checkDown(key)\n```\n\n```lua\n-- Bind a key or a table of keys to the instance.\n-- @_param_ `keys` (string or table) — The keys to bind.\ninstance:keyBind(keyToBind)\n```\n\n```lua\n-- Unbind a key or a table of keys in the instance.\n-- @_param_ `keys` (string or table) — The keys to unbind.\ninstance:keyUnbind(keys)\n```\n\n```lua\n-- Update the state of all bound keys.\ninstance:updateInput()\n```\n\n```lua\n-- Return true if is the first frame the bound key is down.\n-- @_param_ `key` — The key to check.\n-- @_return_ `down` — True if the key is down, false if not.\ninstance:justPressed(key)\n```\n\n```lua\n-- Return true if a bound key is down.\n-- @_param_ `key` — The key to check.\n-- @_return_ `down` — True if the key is down, false if not.\ninstance:isDown(k)\n```\n\n```lua\n-- Return true if is the first frame the bound key is released.\n-- @_param_ `key` — The key to check.\n-- @_return_ `down` — True if the key is released, false if not.\ninstance:justReleased(k)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolas-sabbatini%2Fsimplekey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolas-sabbatini%2Fsimplekey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolas-sabbatini%2Fsimplekey/lists"}