mousetrap
mousetrap copied to clipboard
Simple library for handling keyboard shortcuts in Javascript
The shortcut `command+-` (where + is not a key) does not bind on Firefox. It works on the other browsers I tested - Safari, Chrome, and Brave. Here is a...
Right now, there is no way to remove event listeners which can lead to memory leaks. This will create a function that will remove the event listeners.
mousetrap is basically an abandoned project. Lots of unsolved issues and unmerged pull requests. I want to know are there any better alternatives? Thanks.
It could be convenient to intercept keyEvents on capturing phase and not bubbling one. (I need it for [Hyper](https://github.com/zeit/hyper) to capture and flag key events BEFORE they reach embedded Terminal)....
Example: I have two shortcuts: `i` which will navigate my page and `f+i` which will add a new item to the page. If I just press `i` while selected on...
I want to use ctrl+tab in my electronjs app. So it is not a browser to interrupt with tab changing shortcut. However when I'm inside a text area it doesn't...
Take a look at this and follow the instructions on screen to see what I think is a bug https://jsfiddle.net/9kov1p60/ Basically, if you have two different shortcuts, `g r` and...
https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/which https://github.com/ccampbell/mousetrap/blob/2f9a476ba6158ba69763e4fcf914966cc72ef433/mousetrap.js#L721 ``` if (typeof e.which !== 'number') { e.which = e.keyCode; } ``` should becomes something like ``` const charCode = (typeof e.which == "number") ? e.which : e.keyCode;...
Chrome is showing an "issue" because Mousetrap uses `navigator.platform` which they plan to remove support for in the future. More information in this link https://blog.chromium.org/2021/05/update-on-user-agent-string-reduction.html Suggestion for fix https://web.dev/user-agent-client-hints/ Screenshot...