{"id":17049455,"url":"https://github.com/samccone/behave-ui-hotkeys","last_synced_at":"2026-04-18T00:01:42.832Z","repository":{"id":25587441,"uuid":"29021682","full_name":"samccone/behave-ui-hotkeys","owner":"samccone","description":"A hotkeys Marionette Behavior","archived":false,"fork":false,"pushed_at":"2015-01-09T15:36:05.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T04:27:31.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/samccone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-09T15:23:20.000Z","updated_at":"2021-10-29T14:38:28.000Z","dependencies_parsed_at":"2022-08-24T06:31:15.612Z","dependency_job_id":null,"html_url":"https://github.com/samccone/behave-ui-hotkeys","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samccone/behave-ui-hotkeys","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samccone%2Fbehave-ui-hotkeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samccone%2Fbehave-ui-hotkeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samccone%2Fbehave-ui-hotkeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samccone%2Fbehave-ui-hotkeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samccone","download_url":"https://codeload.github.com/samccone/behave-ui-hotkeys/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samccone%2Fbehave-ui-hotkeys/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T09:54:39.926Z","updated_at":"2026-04-18T00:01:42.813Z","avatar_url":"https://github.com/samccone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# behave-ui-hotkeys\nA Marionette Behavior that allows you to add hotkey functionality to any view.\n\n## Usage:\n\n```\nnpm install --save behave-ui-hotkeys\n```\n\nThen just require and use as you would any other behavior:\n\n```\nvar Hotkeys = require('behave-ui-hotkeys'),\n    _ = require('underscore');\n\nvar View = Marionette.ItemView.extend({\n    template: _.template('\u003ch1\u003eHotkeys!!\u003c/h1\u003e'),\n    behaviors: {\n        Hotkeys: {\n            behaviorClass: Hotkeys,\n            hotkeys: {\n               'cmd:alt:y': 'viewMethod'\n            }\n        }\n    },\n    initialize: function() {\n        this.on('hotkey:cmd:alt:y', function() {\n            // hotkey fired!\n        });\n    },\n    viewMethod: function(e) {\n        // hotkey fired!\n    }\n});\n```\n\nNOTES:\n\n - You can use only one code (f1, 4, a, s, delete, pageup, etc), but as many helper keys (cmd, ctrl, alt, shift) as you would like\n - Codes are case insensitive, F1 will become f1, DELETE will become delete, etc...\n - If you specify a view method that does not exist, it will just call event\n - If you do not want to call a view method pass an empty string as the value, i.e.\n\n```\nhotkeys: {\n    'ctrl:alt:o': 'open', // will fire event: 'hotkey:ctrl:alt:o', will call: this.view.open()\n    'ctrl:alt:p': '' // will only fire event: 'hotkey:ctrl:alt:p', will not call any method\n}\n```\n\nList of accepted codes:\n\n- backspace\n- tab\n- enter\n- return\n- pause\n- esc\n- space\n- pageup\n- pagedown\n- end\n- home\n- left\n- up\n- right\n- down\n- delete\n- 0\n- 1\n- 2\n- 3\n- 4\n- 5\n- 6\n- 7\n- 8\n- 9\n- a\n- b\n- c\n- d\n- e\n- f\n- g\n- h\n- i\n- j\n- k\n- l\n- m\n- n\n- o\n- p\n- q\n- r\n- s\n- t\n- u\n- v\n- w\n- x\n- y\n- z\n- +\n- \\-\n- f1\n- f2\n- f3\n- f4\n- f5\n- f6\n- f7\n- f8\n- f9\n- f10\n- f11\n- f12\n\n## Dev\n\nTo setup the dev environment just run `npm install`\nYou can then run `grunt watch` to automagically run tests and jshint\n\n## Test\n\nTo run tests run either `npm test` or `grunt test`, former is an alias for the latter.\n\n## Release History\n\n- 0.0.1 - Initial Release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamccone%2Fbehave-ui-hotkeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamccone%2Fbehave-ui-hotkeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamccone%2Fbehave-ui-hotkeys/lists"}