[jawsscripts] Trying to use FocusChangedEvent to read some WPF controls etc.

  • From: Jacob Kruger <Jacob.Kruger@xxxxxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 25 Aug 2009 12:37:34 +0200

Working on testing/trying out some of my recent windows presentation foundation 
test applets, and after starting off making use of Jamal's SayTools to get it 
to tell me information about some of the specific control types using C# code, 
and a form of bubbling up onFocus event, but still having to really sort of 
custom code each control types information garnering bit of code, I am now 
trying out the following very simple bit of jaws scripting so far:

Void Function FocusChangedEvent (handle hNew, handle hOld)
var
string sDesc

let sDesc = "object name: " +  GetObjectName (true, 0)
SayString (sDesc)
let sDesc = "window type: " + GetWindowType (hNew)
Say (sDesc, OT_MESSAGE, false)
EndFunction

Firstly, when tabbing around a window with buttons and textboxes on it, it will 
tell me the object name of the control, but tells me it's an unknown window 
type every time. OTOH, if I hit jaws key + F1, it seems to know it's a button 
and must be pressed with spacebar etc.

Now, when I test this same function on a window including a standard menu 
system, the FocusChangedEvent doesn't seem to get triggered at all, so I'm 
unable to even see if it's seeing the menu items at this stage, so I suppose 
I'll have to try hard code a bit of my own control interpretation for even menu 
systems for now, but just thought maybe someone would have a bit of an idea 
what else I could try aside from text searching etc., since it's more like I'm 
trying to find a sort of generic, reusable implementation of jaws scripting to 
help me test work I do in WPF etc.

Lastly, also if I use the home ro utility, it doesn't seem to manage to 'see' 
much in these dialogues either.

Stay well

Jacob Kruger
jacob.kruger@xxxxxxxxxxxx


__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: