jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.66k stars 410 forks source link

Order of keys- does it matter or should it matter ? #425

Closed KMJ-007 closed 1 year ago

KMJ-007 commented 1 year ago

I have this small doubt,

I have command alt+ctrl+o,

but it also works when I press ctrl+alt+o

function ExampleComponent() {
  useHotkeys('alt + ctrl + o', () => alert('Key a was pressed'))

  return (
    <span>Press the a key to see it work.</span>
  )
}

does order matter/should order matter?

will it compare the combined combination ?

because i was expecting that if i only pressed in the combination then only it will work!

but it worked in all combination

if order matters for some people, I was thinking to contribute to the project, where you mention if you want sritct hot key, then it will match the order!

KMJ-007 commented 1 year ago

wrong lib :)