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

Add Key constant values MouseRelease, MouseWheelUp, MouseWheelDown #28

Merged
merged 4 commits into from May 15, 2016

Conversation

bmatsuo
Copy link
Contributor

@bmatsuo bmatsuo commented May 15, 2016

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.

@JoelOtter
Copy link
Owner

Thanks for this - would you mind also adding a small example to the _examples directory, just to ensure it's working?

@bmatsuo
Copy link
Contributor Author

bmatsuo commented May 15, 2016

@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.

@bmatsuo
Copy link
Contributor Author

bmatsuo commented May 15, 2016

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).

"strings"

Copy link
Owner

Choose a reason for hiding this comment

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

Lose this newline

Copy link
Contributor Author

@bmatsuo bmatsuo May 15, 2016

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.

@JoelOtter
Copy link
Owner

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.

@bmatsuo
Copy link
Contributor Author

bmatsuo commented May 15, 2016

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.
@JoelOtter JoelOtter merged commit 4536df8 into JoelOtter:master May 15, 2016
@JoelOtter
Copy link
Owner

Merged! Thank you very much @bmatsuo 👍

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.

None yet

2 participants