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
scroll wheel sends escape sequences in alternate screen mode #282
Conversation
… sequences on scroll in alternate screen mode
Changes Unknown when pulling 3bfaee3 on mmaxim:mmaxim/scroll-wheel-escape into * on gnachman:master*. |
@@ -1546,7 +1546,7 @@ - (void)rightMouseDragged:(NSEvent *)event | |||
[super rightMouseDragged:event]; | |||
} | |||
|
|||
- (BOOL)scrollWheelShouldSendArrowForEvent:(NSEvent *)event at:(NSPoint)point { | |||
- (BOOL)scrollWheelShouldSendAuxForEvent:(NSEvent *)event at:(NSPoint)point upData:(NSData**)upData downData:(NSData**)downData { |
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.
Let's separate computing the data to send from determining if data should be sent. That means two methods:
- (BOOL)scrollWheelShouldSendDataForEvent:(NSEvent *)event
(by not taking a point
we're doing a touch of cleanup here since the point can be computed from the event
and the caller doesn't need it for anything but passing to this method)
and
- (NSData *)dataToSendForScrollEvent:(NSEvent *)event
which calls enclosingScrollView
and accumulateVerticalScrollFromEvent
, and then returns the appropriate data.
@gnachman Thanks for the response! I pushed some changes which I think addresses all of your feedback. Let me know, and thanks! |
Changes Unknown when pulling ae3ace1 on mmaxim:mmaxim/scroll-wheel-escape into * on gnachman:master*. |
Changes Unknown when pulling ae3ace1 on mmaxim:mmaxim/scroll-wheel-escape into * on gnachman:master*. |
Merged as commit 9c63f6f. Thanks! |
Great, thanks! |
The point of this patch is to add an option to make the mouse scroll wheel configurable to send escape sequences in alternate screen mode. This adds onto the similar arrow key option that is already present by creating two more configuration options in the Advanced pane.
The motivation for this change is to be able to implement the technique described here:
https://www.staldal.nu/tech/2009/01/11/how-to-use-mousewheel-in-gnu-screen/
Note: I'm not an Objective-C expert by any means, so I won't be surprised if I did something here that isn't best practice.