I adapted an AHK script I found to be used with Revit. This script allows you to automatically enable Caps Lock while in Revit, and then disables caps lock when you are outside of Revit.

Requires AHK to be installed.

Instructions:
  • Copy Paste code below into your favorite text editor
  • Save the file as RevitCaps.ahk
  • Compile the script to an .exe using AHK
  • Run the .exe file
  • Click inside of Revit, Caps Lock will come on
  • Click in any other program, Caps Lock will turn off
  • Use CTRL+Caps Lock to enable/disable caps lock inside or outside of Revit
  • Use Win+L to lock the machine and disable Caps Lock


Some Caveats:
  • Does not work with Jing! and possibly other screen capture software
  • Does not like ALT+Tab shortcuts while inside of Revit
  • [add more if you find them]



Code:
AutoCapsAcad()

#h::
{
Gui, Add, Text,, Caps Lock disabled
Gui, Add, Text,, Ctrl+Caps Lock = Caps On/Off
Gui, Add, Text,, Win+L turn off Caps before locking workstation
Gui, Show
}
Return

; Disable Caps Lock
Capslock::Return
; Ctrl+Caps Lock = Caps Lock
^Capslock::Capslock
;Win+L turn off Caps Lock before locking workstation
#l::
{
SetCapsLockState, off
DllCall("LockWorkStation")
}
Return


#Persistent


AutoCapsAcad()
{
Loop
{
WinGet,WID1,ID,A
isActive1 := isAcadRelated(WID1)

If isActive2 && !isActive1
SetCapsLockState, off
Else If !isActive2 && isActive1
SetCapsLockState, on

Sleep, 200
WinGet,WID2,ID,A
isActive2 := isAcadRelated(WID2)

If isActive1 && !isActive2
SetCapsLockState, off
Else If !isActive1 && isActive2
SetCapsLockState, on
}
}

isAcadRelated(WinID)
{
RetVal = 0
WinGet ProcessName,ProcessName, ahk_id %WinID%
If (ProcessName = "revit.exe")
{
RetVal = 1
}
Return %RetVal%
}
Enjoy!