Skip to content

Commit

Permalink
fix: make right click work consistently across applications
Browse files Browse the repository at this point in the history
Applications like XCode and Safari
  • Loading branch information
socsieng committed Jan 1, 2021
1 parent d443fdf commit 464a401
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/SendKeysLib/MouseController.swift
Expand Up @@ -29,7 +29,10 @@ class MouseController {
var downMouseType = CGEventType.leftMouseDown
var upMouseType = CGEventType.leftMouseUp

if button != .left {
if button == .right {
downMouseType = CGEventType.rightMouseDown
upMouseType = CGEventType.rightMouseUp
} else if button != .left {
downMouseType = CGEventType.otherMouseDown
upMouseType = CGEventType.otherMouseUp
}
Expand Down Expand Up @@ -59,7 +62,10 @@ class MouseController {
var downMouseType = CGEventType.leftMouseDown
var upMouseType = CGEventType.leftMouseUp

if button != .left {
if button == .right {
downMouseType = CGEventType.rightMouseDown
upMouseType = CGEventType.rightMouseUp
} else if button != .left {
downMouseType = CGEventType.otherMouseDown
upMouseType = CGEventType.otherMouseUp
}
Expand Down

0 comments on commit 464a401

Please sign in to comment.