{"id":31205210,"url":"https://github.com/rodrigoroma/mouse-killer","last_synced_at":"2025-09-20T17:06:53.090Z","repository":{"id":57303187,"uuid":"86182773","full_name":"rodrigoroma/mouse-killer","owner":"rodrigoroma","description":"An Angular.JS directive to bind keyboard shortcuts to buttons (or any other DOM element).","archived":false,"fork":false,"pushed_at":"2017-08-21T12:05:38.000Z","size":40,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-16T08:42:59.523Z","etag":null,"topics":["angular","angularjs","keyboard-shortcuts","shortcut"],"latest_commit_sha":null,"homepage":"https://rodrigoroma.github.io/mouse-killer/","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/rodrigoroma.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":"2017-03-25T19:21:02.000Z","updated_at":"2021-02-07T04:01:55.000Z","dependencies_parsed_at":"2022-08-31T00:01:00.231Z","dependency_job_id":null,"html_url":"https://github.com/rodrigoroma/mouse-killer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/rodrigoroma/mouse-killer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigoroma%2Fmouse-killer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigoroma%2Fmouse-killer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigoroma%2Fmouse-killer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigoroma%2Fmouse-killer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigoroma","download_url":"https://codeload.github.com/rodrigoroma/mouse-killer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigoroma%2Fmouse-killer/sbom","scorecard":{"id":782367,"data":{"date":"2025-08-11","repo":{"name":"github.com/rodrigoroma/mouse-killer","commit":"c501dd8954257ec9e4823ce52ea277b0f5e9f78a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T05:12:53.039Z","repository_id":57303187,"created_at":"2025-08-23T05:12:53.039Z","updated_at":"2025-08-23T05:12:53.039Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275829137,"owners_count":25536268,"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","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["angular","angularjs","keyboard-shortcuts","shortcut"],"created_at":"2025-09-20T17:06:48.450Z","updated_at":"2025-09-20T17:06:53.084Z","avatar_url":"https://github.com/rodrigoroma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mouse-killer\nAn Angular.JS directive to bind keyboard shortcuts to buttons (or any other DOM element).\n\n## Should I use this?\nIf your shortcuts have a strong relationship with DOM elements (like buttons), so probably you want to use this. \n\nThe rule of thumb is:\n\n* If you have a relationship of 1:1 between DOM elements and shortcuts, you probably want to use Mouse Killer.\n* If not, maybe there's a better option for you.\n\nOr: \n\n* If your shortcuts are binded to buttons and you only want to trigger the shortcut if the button can be clicked (ie. it's not disabled, it's not hidden and it's not overrided by other element), so you really want to use Mouse Killer.\n* If not, maybe there's a better option for you.\n\nOr even:\n\n* If you prefer to define the shortcuts directly in you HTML tags, you should consider using Mouse Killer.\n* If you prefer to define the shortcuts in your controller, you should consider using another plugin.\n\nNot sure if Mouse Killer is the option that best suit your needs? So take a look at [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) which has a different approach.\n\n## Installation\n\n1. Add Mouse Killer to your project.\n\n    * Using **Bower**: `bower install mouse-killer --save`\n    * Using **NPM**: `npm install mouse-killer --save`\n    * Or directly downloading `dist/mouse-killer.js` file.\n\n2. Include `mouse-killer.js` in your HTML:\n    \n        \u003cscript src=\"/bower_components/mouse-killer/dist/mouse-killer.min.js\"\u003e\u003c/script\u003e\n\n3. Add **mouseKiller** as a dependency to your AngularJS app:\n\n        angular.module('myApp', [\n            'mouseKiller'\n        ])\n\n## Usage\nComplete example: \n\n    \u003cbutton \n        mk-shortcut=\"ctrl + enter\"\n        mk-hint=\"title\"\n        mk-hint-title=\"The shortcut for this button is %\"\n        mk-event=\"click\"\n        mk-prevent-default=\"true\"\n        mk-stop-propagation=\"true\"\n        mk-enabled=\"auto\"\u003eButton\u003c/button\u003e\n\n| Attribute           | Required | Default     | Description                                                   |\n|---------------------|----------|-------------|---------------------------------------------------------------|\n| mk-shortcut         | Yes      | -           | The key combination (see below).                              |\n| mk-hint             | No       | title       | `none` doesn't display a hint for the shortcut. \u003cbr /\u003e`title` display the shortcut in the *title* attribute of the element. \u003cbr /\u003e`inline` appends the shortcut to the inner text of the element. Example: **Button text** becomes **Button text (F8)** |\n| mk-hint-title       | No       | Shortcut: % | If `mk-hint` is set to `title`, this attribute defines how the title will be. The character `%` will be replaced by the shortcut. |\n| mk-event            | No       | click       | The event to be triggered on the element when the shortcut is pressed. |\n| mk-prevent-default  | No       | true        | Choose if Mouse Killer will try to prevent the browser default action for the shortcut (like open the find tool if `F3` is pressed or open a file if `ctrl+o` is pressed). |\n| mk-stop-propagation | No       | true        | Choose if Mouse Killer will stop the event propagation to prevent others event handlers from firing another action. |\n| mk-enabled          | No       | auto        | An expression that returns one of the following values:\u003cbr /\u003e `true` the shortcut is enabled.\u003cbr /\u003e`false` the shortcut is disabled.\u003cbr /\u003e`auto` this string makes the shortcut enabled if the element is clickable EXCEPT if the focus is on an input field AND the shortcut has only one key.\u003cbr /\u003e`function(elem, evt, isClickable)` a function that returns true or false. The first parameter is the element where the shortcut is bound to. The second parameter is the kespressed event. The third parameter is a boolean that indicates if the user could manually click the element (i.e. it's not disabled, hidden or overrided). |\n\n### Directive default configuration\nYou can use the `.config()` of your application to set the directive default parameters (that can be overrided by some attribute).\n\nIn the code below you can see all the parameters that can be set.\n\n    app.config(['mouseKillerProvider', function(mouseKillerProvider) {\n        mouseKillerProvider.setHint('title');\n        mouseKillerProvider.setHintTitle('Be faster using the % shortcut');\n        mouseKillerProvider.setEvent('focus');\n        mouseKillerProvider.setPreventDefault(true);\n        mouseKillerProvider.setStopPropagation(false);\n        mouseKillerProvider.setEnabled(true);\n    }]);\n\n### Non-overridable shortcuts\nFor security reasons, there are some shortcuts that can't be overrided/prevented and it varies by browser. For example, Google Chrome won't let you override the `ctrl+n` shortcut.\n\n### Valid shortcuts\nKeys in a key combination should be separated by the `+` character. In your shortcut, you can have:\n* Any number of modifier keys\n* Zero or one normal key\n\nExamples of valid shortcuts:\n* `ctrl+enter`\n* `ctrl+alt+k`\n* `w`\n* `Ctrl` (shortcuts are case-insensitive)\n* `CTRL + Shift+ F` (shortcuts are \"space-insensitive\")\n* `ctrl + {32}` (use `{xxx}` to specify a key by its key code)\n\n#### Modifiers\nThe following strings are considered modifiers keys:\n\n| Modifier keys        |\n|----------------------|\n| `ctrl`               |\n| `alt`                |\n| `shift`              |\n| `meta` (Windows key) |\n\n#### Keys\n| Letters |   | Numbers | Numpad | Fx | Misc. |\n|---------|---|---------|--------|----|-------|\n| a | n | 0 | numpad 0 | f1 | backspace |\n| b | o | 1 | numpad 1 | f2 | tab |\n| c | p | 2 | numpad 2 | f3 | enter |\n| d | q | 3 | numpad 3 | f4 | esc |\n| e | r | 4 | numpad 4 | f5 | page up |\n| f | s | 5 | numpad 5 | f6 | page down |\n| g | t | 6 | numpad 6 | f7 | end |\n| h | u | 7 | numpad 7 | f8 | home |\n| i | v | 8 | numpad 8 | f9 | left arrow |\n| j | w | 9 | numpad 9 | f10 | up arrow |\n| k | x |   | multiply | f11 | right arrow |\n| l | y |   | add | f12 | down arrow |\n| m | z |   | subtract |  | insert |\n|   |   |   | decimal point |  | delete |\n|   |   |   | divide |  |  |\n\n\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigoroma%2Fmouse-killer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigoroma%2Fmouse-killer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigoroma%2Fmouse-killer/lists"}