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

issue with 3 keys combination. #55

Open
digital230 opened this issue Mar 6, 2019 · 4 comments
Open

issue with 3 keys combination. #55

digital230 opened this issue Mar 6, 2019 · 4 comments
Labels

Comments

@digital230
Copy link

i have created a global shortkeys handler. i require keys data in a certain way. for example
{ key: "alt+s+n", action: () => this.setState({ showShortKeys: true }) },

the issue is when we use 3 keys like above it not only work with 3 keys but also it works when we press alt+n . with three keys combination it also execute same action with first and last stroke i.e alt+n.
the error we are facing is there are two keys alt+n and alt+s+n so when press alt+n it execute both operations associated to both keys.

@hi-otto
Copy link

hi-otto commented Mar 26, 2019

i have the some problem

@jaywcjlove
Copy link
Owner

@digital230 Support for three-key combination. Upgrade + hotkeys-js@3.6.0.

Example: https://codepen.io/jaywcjlove/pen/BbEeVX

hotkeys('alt+s+n', function(event,handler) {
  if(handler.key === 'alt+s+n') {
    alert('you pressed alt+s+n!');
  }
});

@jide
Copy link

jide commented Mar 27, 2019

For me the codepen does not work.

Moreover, I still get the issue with 3.6.0. The issue is with a combination of 2keys and 3-keys :

      hotkeys('command+shift+z,command+z', (event, handler) => {
        console.log(handler.key); // does not trigger when shift is pressed.
      });

@jaywcjlove
Copy link
Owner

@jide Upgrade + hotkeys-js@3.6.1.
Example: https://codepen.io/jaywcjlove/pen/dLbNZm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants