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
Add Key constant values MouseRelease, MouseWheelUp, MouseWheelDown #28
Conversation
Thanks for this - would you mind also adding a small example to the |
@JoelOtter oh, sure. That wouldn't be hard. Though it appears to be ~covered by the current click.go example. That's the only mouse example, so it is covered as well as any other mouse button handling. =/ I can start working on something a little more instructional about handling the key values though. It is not hard, obviously. I just thought I should bring that up. |
I have updated click.go so that info for each mouse event is written to the screen (using nice names for the key values). This is enough to validate that MouseWheelUp, MouseWheenDown, and MouseRelease are working properly (along with the previously defined constants). |
The example will display the hex code for the unknown key.
"strings" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lose this newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Derp. They are included automatically by goimports. I always forget about it in other people's repos. Maybe I can get vim to detect and use gofmt/goimports based on the path.
Looks good! I think we should have a demo at some point for how to do click-and-drag. Not needed in this change, though. Just those tiny nitpicks and I'll happily merge this. |
The your comments have all been addressed, @JoelOtter. Thanks. |
Don't use goimports style for imports (i.e. with spaces between stdlib and third-party imports). And, use consistent capitalization in the click.go example.
Merged! Thank you very much @bmatsuo 👍 |
Fixes #25
This just defines the missing mouse constants from termbox-go. There doesn't seem to be anything more needed to handle these mouse events. But let me know if I'm missing something and I will update the patch.