' ------------------------------------------------------------------------------------ ' ChangeJPSMax.vbs ' This script is used to control from the keyboard the MAX_JPSView extension. ' Define shortcuts to this script for the following keys: ' - Ctrl+0: Parallel viewing ' - Ctrl+1: Single image viewing ' - Ctrl+2: Over/Under viewing '---------- - Ctrl+3: Gray anaglyph ' - Ctrl+4: Cycle between color and B&W anaglyphs ' - Ctrl+5: Swap left and right images ' - Ctrl+6: Mirror first picture ' - Ctrl+7: Mirror second picture ' - Ctrl+8: Horizontaly interlaced image (should be used with zoom 1:1) ' - Ctrl+9: Reset to default values. ' ------------------------------------------------------------------------------------ Option Explicit ' Key codes for the 0-9 keys (NOT on the numerical keypad) const VK_NUM0 = &h30 const VK_NUM3 = &h33 const VK_NUM4 = &h34 const VK_NUM5 = &h35 const VK_NUM6 = &h36 const VK_NUM7 = &h37 const VK_NUM8 = &h38 const VK_NUM9 = &h39 Dim jpsMAX, fsv, k, nMode, bSwap App.ClearTrace set jpsMAX = App.GetMAX( "MAX_JPSView" ) if not jpsMAX is Nothing then jpsMAX.Execute "mode=?" nMode = CInt( jpsMAX.GetResult ) app.Trace "Current mode is: " & nMode jpsMAX.Execute "swap=?" bSwap = CInt( jpsMAX.GetResult ) app.Trace "Swap is: " & CInt( jpsMAX.GetResult ) k = (app.lLastKeyPressed and &hff) if k >= VK_NUM0 and k < VK_NUM3 then ' Get the number of the target album k = k - VK_NUM0 jpsMAX.Execute "mode=" & k elseif k = VK_NUM4 then ' Cycle between red-cyan anaglyphs if nMode = 3 then jpsMAX.Execute "mode=" & 9 elseif nMode = 4 then jpsMAX.Execute "mode=" & 3 elseif nMode = 9 then jpsMAX.Execute "mode=" & 4 else jpsMAX.Execute "mode=" & 9 end if elseif k = VK_NUM3 then ' Cycle other anaglyph types if nMode = 5 then jpsMAX.Execute "mode=" & 10 elseif nMode = 10 then jpsMAX.Execute "mode=" & 5 else jpsMAX.Execute "mode=" & 5 end if elseif k = VK_NUM8 then jpsMAX.Execute "mode=" & 7 elseif k = VK_NUM5 then jpsMAX.Execute "swap=" & 1-bSwap elseif k = VK_NUM6 then ToggleValue "mirror1" elseif k = VK_NUM7 then ToggleValue "mirror2" elseif k = VK_NUM9 then jpsMAX.Execute "mode=0" jpsMAX.Execute "swap=0" jpsMAX.Execute "mirror1=0" jpsMAX.Execute "mirror2=0" end if set fsv = app.GetFullScreenView if not fsv is Nothing then fsv.ReloadPicture True 'fsv.MoveImage (nCmd As Long, bCorners As Bool) end if end if sub ToggleValue( sValue ) dim b jpsMAX.Execute sValue & "=?" b = 1-CInt( jpsMAX.GetResult ) jpsMAX.Execute sValue & "=" & b end sub