How to not focus input on keyboard key #2 combination


I want to make some action on keyboard key combination, in this case #2
issue is that i have input in page that have and need autofocus. …
So when i hit #2 it types it inside input

Example: (click outside input to see that #2 works)

Question is how to tell it if entered combination #2 to leave input and do function?

P.S. I m using Mousetrap.js

Hi @fumeeptc, according to the docs you can add a mousetrap class to the input element so that the combination also works inside it. This will also leave the input.

1 Like

Oh my i never saw that :slight_smile: Thanks allot!!

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.