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 a custom mouse event wrapper around tcell's one #11

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

n-peugnet
Copy link
Contributor

This wrapper implements the HasMotion() function which value is set by the main application based on the previous mouse event.

If I understood gdamore/tcell#622 (comment) correctly (emphasis is mine):

Just so we are clear here -- what discriminates a "click" vs. a held drag, is that a click will send an event with buttons set to none. If you get multiple location reports with the buttons unchanged, then the user has been holding the buttons.

With this change, we should be able to use upstream tcell. See #10

I tested this quickly in Gomuks and the selection of text in the message input seemd to behave as expected.

This wrapper implements the HasMotion() function which value is set by
the main application based on the previous mouse event.
@nileshpatra
Copy link

Shouldn't go.mod also be updated to point to gdamore/tcell?

@n-peugnet
Copy link
Contributor Author

n-peugnet commented Feb 21, 2024

Shouldn't go.mod also be updated to point to gdamore/tcell?

This can be done afterwards, but I can also add it in this pull request. I already have it ready in n-peugnet@5017f77 (then I am able to build Gomuks with this commit n-peugnet/gomuks@ad0c752).
What do you think @tulir?

@nileshpatra
Copy link

@tulir can you please review/merge this? This would be very very useful for maintaining gomuks in Debian

@tulir tulir merged commit 7bcc294 into tulir:main Mar 17, 2024
3 checks passed
@nileshpatra
Copy link

Shouldn't go.mod also be updated to point to gdamore/tcell?

This can be done afterwards, but I can also add it in this pull request. I already have it ready in n-peugnet@5017f77 (then I am able to build Gomuks with this commit n-peugnet/gomuks@ad0c752). What do you think @tulir?

Now that this PR is merged, can the change to point it to gdamore/tcell go in?

@n-peugnet
Copy link
Contributor Author

Now that this PR is merged, can the change to point it to gdamore/tcell go in?

I just made a new pull request for this: #12

@nileshpatra
Copy link

I built gomuks with your commits. It does build, however unfortunately, the scrolls do not work properly for me. I try to scroll up/down and nothing happens, or it goes up/down after several attempts. That isn't the case for gomuks built w/o these commits.

Asked @alexmyczko to check as well.

@n-peugnet
Copy link
Contributor Author

the scrolls do not work properly for me. I try to scroll up/down and nothing happens, or it goes up/down after several attempts.

Sorry, you are right, I didn't test this enough. Simply checking that the buttons bitset is the same is not enough.

tulir added a commit that referenced this pull request Apr 9, 2024
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

3 participants