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

Press multiple keys at the same time. #60

Open
ninjabunny-dev opened this issue Jun 13, 2018 · 6 comments
Open

Press multiple keys at the same time. #60

ninjabunny-dev opened this issue Jun 13, 2018 · 6 comments
Labels
Question General questions about the library

Comments

@ninjabunny-dev
Copy link

I am working on a project where I need to press multiple keys at the same time. I have tried things like.

  keyboard.press(robot.KEY_W);
  keyboard.click(robot.KEY_S);
  keyboard.release(robot.KEY_W);

It doesn't hit them at the same time, I also fiddled with the autoDelay but this made the inputs unreliable. Is there a way to archive this? Any help will be much appreciated.

@dkrutsko
Copy link
Member

mmm that should work, I'm not sure why it's not working for you. What operating system is this?

@ninjabunny-dev
Copy link
Author

I'm on Windows 10

@ninjabunny-dev
Copy link
Author

I am trying to send keys one or two milliseconds apart. I think I might have to use the something lower level than node.

@dkrutsko
Copy link
Member

So the keyboard functions are blocking, so the send input's do get executed in the correct order. It's weird that it doesn't in your case.

@dkrutsko dkrutsko added the Question General questions about the library label Jun 13, 2018
@ninjabunny-dev
Copy link
Author

I set keyboard.autoDelay.min = 10; keyboard.autoDelay.max = 30; and that seemed to do the trick

@dkrutsko
Copy link
Member

I'd see if you get the same problem in C++, using either robot or SendInput.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question General questions about the library
Development

No branches or pull requests

2 participants