1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 02:54:31 +03:00

Add Support for Right and Middle Mouse buttons

This commit is contained in:
Atishay Jain 2022-01-20 22:29:58 -08:00
parent 751237cc8f
commit a39cc580cf

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 }