How do I use WASD for Pan instead of arrow keys

Hello, 

I was wondering if there was a way that I could change the default Pan settings to use WASD instead of arrow keys? I have looked into the "Settings -> Customize -> Keyboard" options to see if I could change it but that was but was unsuccessful. I use none of the other shortcuts that are bound to those keys so I was hoping I could have WASD always on pan, moving the screen in the assumed directions.

Thank you!

Answers 3
JH
JH 2025-06-02

Good question! It would appear as CTRL+arrow keys is hardcoded and not customizable.

JB
JB 2025-06-02

I think you'd have to write four macros to pan each direction and map them to the WASD keys.

JB
JB 2025-06-02

The macros are super simple (see below).  All four can reside in a single .swp file.  When you map the WASD keys, you can select which one of the four subs to map each one with.  I could have sworn there was an option/setting for both pan amount and rotation amount for the arrow key, but I could only find the setting for rotation amount.  The "0.025" in the code is guess-and-check to match what happened on my PC.  YMMV, you can change it to anything you want.

Const DIST As Double = 0.025

Sub PanUp()
   Pan "U"
End Sub

Sub PanDn()
   Pan "D"
End Sub

Sub PanL()
   Pan "L"
End Sub

Sub PanR()
   Pan "R"
End Sub

Sub Pan(theDir As String)
   Dim swMview As SldWorks.ModelView
   Set swMview = Application.SldWorks.ActiveDoc.ActiveView
   Select Case theDir
       Case "U"
           swMview.TranslateBy 0, DIST
       Case "D"
           swMview.TranslateBy 0, -DIST
       Case "L"
           swMview.TranslateBy -DIST, 0
       Case "R"
           swMview.TranslateBy DIST, 0
   End Select
End Sub