tui/input.c: add support for mouse release events in urxvt #8309
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some terminals don't report which buttons are involved in some mouse events. For example, the urxvt protocol (http://www.huge-man-linux.net/man7/urxvt.html section "Mouse reporting") does not report which button has been released.
In this case libtermkey reports button 0 (http://www.leonerd.org.uk/code/libtermkey/doc/termkey_interpret_mouse.3.html)
The function
forward_mouse_event
completely disregard the casebutton==0
. On press events, there is not much we can do, and we keep the current behavior which is dropping the event. But on drag and release events we can compensate the loss of functionnality by remembering which button was last pressed.Fixes #3182 for urxvt.
I tested that #3182 still works in xterm as well.