Fez Vrasta
Fez Vrasta

Reputation: 14835

Detect primary button of `?` character

I'm using Mousetrap to detect the press of alt + /

Actually I'm doing so because I'm interested to the alternative character printed on the / button (the ?)

If for an user using english keyboard (or any keyboard with ? assigned as secondary action of the / button) can be simple to understand why I'm asking him to press such key, for an user with a different keyboard (comes to my mind the Italian keyboard where the ? has its own dedicated button) it will be hard to understand why I'm asking him to press such button.

The question then is:

Is there a way to know which button has the ? symbol on it, and then bind the Mousetrap shortcut to such button?

Upvotes: 0

Views: 38

Answers (1)

Tony Wu
Tony Wu

Reputation: 1107

Mousetrap.bind('?', function() { alert('keyboard shortcuts'); });

https://craig.is/killing/mice#api.bind.shift

Upvotes: 0

Related Questions