Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KMJ-007 opened this issue Apr 16, 2023 · 4 comments
Open

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

KMJ-007 opened this issue Apr 16, 2023 · 4 comments
Labels
Version 5.x These tickets will be solved in Version 5.x

Comments

@KMJ-007
Copy link

KMJ-007 commented Apr 16, 2023

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!

@JohannesKlauss
Copy link
Owner

The order doesn't matter, all combination will trigger the callback since the hook only check if all those keys are pressed down and doesn't keep track of the order.

What you are basically asking for is a timed combination something like this: #989

If you want to take this issue I'd be happy to give you some pointers.

@KMJ-007
Copy link
Author

KMJ-007 commented Apr 17, 2023

yes i would love to take this issue!

it would be great help if you can guide me of how can i do this

@SharonGrossman
Copy link

@JohannesKlauss I could also help if given some direction or thoughts 🙏

@JohannesKlauss
Copy link
Owner

I think it makes sense to hold this ticket until version 5 gets released and all those nasty key and keyCode confusion bugs are getting sorted out.

@JohannesKlauss JohannesKlauss added the Version 5.x These tickets will be solved in Version 5.x label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Version 5.x These tickets will be solved in Version 5.x
Projects
None yet
Development

No branches or pull requests

3 participants