1
1
mirror of https://github.com/qvacua/vimr.git synced 2025-01-07 14:39:55 +03:00

Merge pull request #895 from atishay/rightMouse

Add Support for Right and Middle Mouse buttons
This commit is contained in:
Tae Won Ha 2022-02-12 12:21:30 +01:00 committed by GitHub
commit c30f098340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,30 @@ extension NvimView {
self.mouse(event: event, vimName: "LeftDrag")
}
override public func rightMouseDown(with event: NSEvent) {
self.mouse(event: event, vimName: "RightMouse")
}
override public func rightMouseUp(with event: NSEvent) {
self.mouse(event: event, vimName: "RightRelease")
}
override public func rightMouseDragged(with event: NSEvent) {
self.mouse(event: event, vimName: "RightDrag")
}
override public func otherMouseUp(with event: NSEvent) {
self.mouse(event: event, vimName: "MiddleMouse")
}
override public func otherMouseDown(with event: NSEvent) {
self.mouse(event: event, vimName: "MiddleRelease")
}
override public func otherMouseDragged(with event: NSEvent) {
self.mouse(event: event, vimName: "MiddleDrag")
}
override public func scrollWheel(with event: NSEvent) {
let (deltaX, deltaY) = (event.scrollingDeltaX, event.scrollingDeltaY)
if deltaX == 0, deltaY == 0 { return }