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

Unable to handle paste #9

Closed
kim0 opened this issue Jun 18, 2018 · 1 comment
Closed

Unable to handle paste #9

kim0 opened this issue Jun 18, 2018 · 1 comment

Comments

@kim0
Copy link

kim0 commented Jun 18, 2018

In my code, I'm continuously calling keyboard.GetKey() in a for loop, taking the resulting character and sending it down a golang channel. It seemed to work very well, however, I accidentally pasted like 10 characters. And the resulting behavior was strange. GetKey() emitted only the first character in the paste string then waited. If I pressed an 11th character on the keyboard, it would emit character number 2 of the originally pasted string. If I clicked 12th character, it would emit the 3rd and so on.

So effectively it has buffered the whole thing and is emitting a character only upon every key press. I would not have expected that. The proper behavior IMO, was for GetKey() to continuously emit keys rapidly until it's out of keys.

Thanks again for the good library

@eiannone
Copy link
Owner

This is fixed with 4ef8fe4

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

No branches or pull requests

2 participants