Pan and Orbit in Solidworks With a Trackpad (No Middle Mouse Button)
by suyuchen in Workshop > 3D Printing
49 Views, 0 Favorites, 0 Comments
Pan and Orbit in Solidworks With a Trackpad (No Middle Mouse Button)
Like a lot of other CAD programs, Solidworks uses the Middle Mouse Button to pan and orbit the view. Most laptop trackpads do not have a middle mouse button, so you have to have a mouse to do anything. But sometimes, it's quite convenient to be able to still make stuff without a mouse.
Using AutoHotKey, it is possible to emulate the middle mouse button so that pan and orbit can still be used on a laptop.
Install AutoHotKey
Download and install the current version of AutoHotKey: https://www.autohotkey.com/
Create Script
Create a new AutoHotKey (.ahk) file in any desired location, open it in a text editor (like Notepad) and paste the below script. My script uses F2 + Left mouse button to pan and F4 + left mouse button to orbit, if you want to use other keys, you can simply change all instances of F2 and F4 in the script to any other keys (just keep in mind the normal function of the keys you choose will no longer work properly).
This script will only affect Solidworks and not any other application.
Once done, save the script.
; SOLIDWORKS TRACKPAD SCRIPT ; F2 + Left mouse button to pan ; F4 + Left mouse button to orbit #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #If WinActive("SOLIDWORKS") && (getkeystate("F2", "P") || getkeystate("F4", "P")) LButton::MButton LButton up::Send {MButton up} #If #If WinActive("SOLIDWORKS") && getkeystate("F4", "P") F2::Return #If #If WinActive("SOLIDWORKS") F2::Control F4::Return #If
Run Script
Double click on the script file to run it. The new pan and orbit shortcuts should work.
Whenever you want to use Solidworks without a mouse, just double click the script.
If you don't want the script running in the background after you're done, you can stop it by finding the script in the menu at the bottom right of the Windows taskbar, right clicking and selecting "Exit".
If you want this script to always run when your computer turns on, you can have it run on startup. There are many tutorials online to do this, so you can just google this.