Skip to content

Instantly share code, notes, and snippets.

@ash2703
Last active May 30, 2025 22:32
Show Gist options
  • Save ash2703/1bbd056b02fd5ba9e6a49795a7693071 to your computer and use it in GitHub Desktop.
Save ash2703/1bbd056b02fd5ba9e6a49795a7693071 to your computer and use it in GitHub Desktop.
Enable external mouse gestures on MAC

Gestures on external mouse

Install xGestures

Install xGestures

Install scrollreverser

Life Will Be Easier

Save below codes as separate *.scpt files in a folder

#left.scpt
tell application "System Events" to key code 124 using control down
#right.scpt
tell application "System Events" to key code 123 using control down
#up.scpt
tell application "System Events" to key code 126 using control down
#down.scpt
tell application "System Events" to key code 125 using control down

For more event codes: https://apple.stackexchange.com/questions/36943/how-do-i-automate-a-key-press-in-applescript

@ash2703
Copy link
Author

ash2703 commented Dec 9, 2021

Select the key which you want to use for performing the gestures.(In my case "Middle Mouse Button")

home-xgestures

@ash2703
Copy link
Author

ash2703 commented Dec 9, 2021

Enable xGestures in the Options tab, and start xGestures if not already

options-xgestures

@ash2703
Copy link
Author

ash2703 commented Dec 9, 2021

Create new gestures from the applications tab. Enable "global gestures"
Set the "Gesture Action" to "Run AppleScript" and select appropriate scripts to run which we created in the first step.
Ex.: For "down" select "down.scpt" # Feel free to mess with order as per your convenience

Don't forget to Apply Settings once done ;)
app-xgestures

@ash2703
Copy link
Author

ash2703 commented Dec 9, 2021

Create new gestures by clicking on the UI, "left" here means: when mouse is moved to left while pressing the gesture button which is middle button for me

left-xgestures

@ash2703
Copy link
Author

ash2703 commented Dec 9, 2021

Sync trackpad and mouse behaviour else it's a havoc!!
reverser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment