{"id":15059704,"url":"https://github.com/derrickreimer/elm-keys","last_synced_at":"2025-04-10T05:41:33.214Z","repository":{"id":62418417,"uuid":"140017546","full_name":"derrickreimer/elm-keys","owner":"derrickreimer","description":"Advanced keyboard event bindings for Elm","archived":false,"fork":false,"pushed_at":"2018-11-10T19:36:15.000Z","size":10,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:54:38.476Z","etag":null,"topics":["elm","elm-lang","keyboard-events"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/derrickreimer/elm-keys/latest","language":"Elm","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/derrickreimer.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":"2018-07-06T18:20:05.000Z","updated_at":"2020-01-14T21:32:16.000Z","dependencies_parsed_at":"2022-11-01T16:47:36.404Z","dependency_job_id":null,"html_url":"https://github.com/derrickreimer/elm-keys","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/derrickreimer%2Felm-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickreimer%2Felm-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickreimer%2Felm-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derrickreimer%2Felm-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derrickreimer","download_url":"https://codeload.github.com/derrickreimer/elm-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166242,"owners_count":21058475,"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":["elm","elm-lang","keyboard-events"],"created_at":"2024-09-24T22:46:52.488Z","updated_at":"2025-04-10T05:41:33.191Z","avatar_url":"https://github.com/derrickreimer.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keyboard Events for Elm\n\nThis library provides keyboard event functions, similar to the helpers provided in [Html.Events](http://package.elm-lang.org/packages/elm-lang/html/latest/Html-Events).\n\n[![Travis build status](https://travis-ci.org/derrickreimer/elm-keys.svg?branch=master)](https://travis-ci.org/derrickreimer/elm-keys)\n\n## Usage\n\nThe core event types this library supports are `keydown`, `keypress`, and `keyup`. Since it's often necessary to listen for multiple keyboard events on a given form control, the event functions accept a list of listener criteria that map to particular message constructor.\n\nSuppose you have a `\u003ctextarea\u003e` and you would like to:\n\n- Close the editor when the user presses `Esc`,\n- Submit the value when `Meta + Enter` is pressed (on a Mac, the meta key is Command), and\n- Prevent the default behavior when either of those keys are pressed.\n\nYour program (partially) might look something like this:\n\n```elm\nimport Keys exposing (Modifier(..), KeyboardEvent, preventDefault, onKeydown)\n\n\ntype Msg\n    = MetaEnterPressed KeyboardEvent\n    | EscPressed KeyboardEvent\n\n\nview : Html Msg\nview =\n    textarea\n        [ onKeydown preventDefault\n            [ ( [ Meta ], Keys.enter, MetaEnterPressed )\n            , ( [], Keys.esc, EscPressed )\n            ]\n        ]\n        []\n\n\n-- Other program details omitted\n```\n\nThe first argument is a set of options (see [`Html.Events` options](http://package.elm-lang.org/packages/elm-lang/html/latest/Html-Events#Options)).\n\nThe second is a list of three-part tuples containing:\n\n- a list of modifier keys,\n- a key code, and\n- a message constructor.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderrickreimer%2Felm-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderrickreimer%2Felm-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderrickreimer%2Felm-keys/lists"}