Keyboard shortcut to/from variable section in test window

Claus Pedersen

Member³
Is there a way to navigate via keyboard to the variable section of the Test window?

I make a new test and want to enter variable values. This is (to my knowledge) only possible by changing the cursor focus using the mouse. And I do not want to use my mouse in a code editing environment (!)
 
You could use AutoHotKey for this.

Pick a spot in the TestWindow's Variable display that will always be at that spot and do

#/:: ; press Windows Key and /
click, 400, 836
return

Once you install AutoHotKey (autohotkey.com) you would run AU3_Spy.exe to find the screen coordinates to use for your setup.

 
OK, I figured out a 'better' way.

Using AutoHotKey, use the following:

#/:: ; press Windows Key and /
Control = TtsGrid5
WindowTitle = PL/SQL
msg = 0x0007, Clipboard:="0x0007 ;WM_SETFOCUS"

SetTitleMatchMode, 1

PostMessage, %msg%, %wParam%, %lParam%, %Control%, %WindowTitle%
return
 
My apologies, I didn't test enough. The Variable section of the Test Window can be different each time, so hardcoding the TtsGrid5 will fail some times.
 
OK, I couldn't leave this one alone. I think that I have the solution. There was a problem of how to get the cursor into a recognizable field, once it was in the grid (by default it is in the far left column, to the left of the variable name column). This code puts it into the value column of the first entry in the grid. If you don't mind having to cursor over you can remove the ControlSend line.

#/:: ; press Windows Key and /
WinGet, ActiveControlList, ControlList, A

Loop, Parse, ActiveControlList, `n
{
controlname := substr( A_LoopField, 1, 7 )
ifequal, controlname, TtsGrid
{
controlget, vis, visible, , %A_LoopField%, A

ifequal, vis, 1
{
ControlFocus, %A_LoopField%, A
ControlSend, %A_LoopField%, {Left 100}{right 3}, A
}

}
}
return
 
Back
Top