-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix old getKey after getKeys merge #47
Conversation
@inv2004 I don't like exposing The model should be you keep calling I should have commented on your previous PR about this, |
@johnnovak the change is just addition fix to the prev PR I suppose we can discuss it in separate issue. I think that that I understand your point, because I thought about some kind of buffer during the prev PR implementation, but I was not sure how to work correct with it in event loop with sleep timeout, an I found that it a a bit overcomplicate compared to seq[Key] because you need the buffer/seq anyway and it is not very obvious that you can do timeout only after Key.None. At least it does not fit the example in readme -- added -- |
Well, it's my repo @inv2004, so we can discuss it here, I don't mind at all 😄 The guy in the original issue ticket described how this should work:
Read the rest of his comment for extra details. Basically, don't overthink it; the client just needs to keep calling The fact that we're internally buffering is 100% an implementation detail—all the client should care about is calling getKey once per the event loop to get all key presses, eventually (or multiple times, really up to them; from the point of view of the library we don't care). Feel free to make these changes in this PR. So |
No reasons to hold the PR (because the I am not 100% sure that just getKey is better at the moment. Lets continue here: #48 |
@johnnovak Please do not forget to lift version again after the merge |
@inv2004 This works well on macOS, haven't tested on Windows yet. However, that super messy |
@johnnovak Probably the dance around For the moment it is up to you to merge or not. I am ok to use the branch from my repo |
Ok @inv2004 can you address my further minor comments and clean up the history? This whole thing should go in a single commit, please squash & rebase off main. Then in it goes... Could be useful for some, and I'm not really maintaining this anyway 😄 |
I suppose that squash and & merge or rebase is just one github button on your side |
Indeed, I can squash & merge. I'm just used to a rebase workflow and that's greyed out because of your merge commits. All good now, thanks 😄 |
Looks like old
getKey
was broken here: #45