Skip to content

Add press duration to PressedActionInfo#33

Merged
quasilyte merged 3 commits intoquasilyte:masterfrom
PirateCatStudios:press-duration
Nov 1, 2023
Merged

Add press duration to PressedActionInfo#33
quasilyte merged 3 commits intoquasilyte:masterfrom
PirateCatStudios:press-duration

Conversation

@phalasz
Copy link
Copy Markdown
Contributor

@phalasz phalasz commented Oct 31, 2023

Add key press duration to the PressedActionInfo's EventInfo.
Resolves #32

I've included an internal minOf implementation. This can be removed if the required go version can be bumped to 1.21.0+ which has a built-in min function with variadic parameter support.

@quasilyte
Copy link
Copy Markdown
Owner

I'll take a closer look tomorrow, but I think it looks good.
I would like to mention that the duration is in frames, as it may not be obvious unless you're expecting it to have the same API as inpututil.

…me length in ticks as inpututil.KeyPressDuration
@phalasz
Copy link
Copy Markdown
Contributor Author

phalasz commented Oct 31, 2023

Sure, no worries. Let me know if changes are needed or if there are improvements that should be made.

Copy link
Copy Markdown
Owner

@quasilyte quasilyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do a couple of nits, but I don't see a reason to do it. :)
This code is good.
I'll fix a couple of comment-related issues like double spaces myself.

Thank you for the implementation of this feature. 👍

@quasilyte
Copy link
Copy Markdown
Owner

We may want to add something that uses this feature in the examples though.
It could be a new example or some extension to an already existing example.

@quasilyte quasilyte merged commit 2237944 into quasilyte:master Nov 1, 2023
quasilyte added a commit that referenced this pull request Nov 1, 2023
quasilyte added a commit that referenced this pull request Nov 1, 2023
@phalasz phalasz deleted the press-duration branch November 1, 2023 21:03
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

Successfully merging this pull request may close these issues.

KeyPressDuration in EventInfo

2 participants