Aaron,
I tried hooking the MSAAEventSource over the weekend and it was actually quite 
successful in giving me access to the focus changes and the objects. My biggest 
problem with this approach was that my script was still responding to the 
default action for the down arrow and thus, it would start speaking the text I 
didn't want before my OnObjectFocus event kicked in and issued the silence and 
the Speak for what I wanted. This resulted in a stuttering output response. I 
guess I could issue the registerHotKey for the down arrow to consume the 
keystroke and combine that with the MSAAEventSource logic to achieve my goal. 
Just getting my feet wet with the Window-Eyes scripting and am trying to be 
careful not to engineer a solution that could be much cleaner if I had more 
experience. <smile>


-----Original Message-----
From: Aaron Smith [mailto:[EMAIL PROTECTED]
Sent: Monday, September 29, 2008 10:09 AM
To: [email protected]
Subject: Re: trying to read currently focused control on "down arrow"

Jay,

What about hooking the MSAAEventSource's OnObjectFocus event instead of 
Window's OnChildFocus?

Aaron

Macarty, Jay {PBSG} wrote:
> In one of my scripts, I am trying to obtain the accessible.name and
> accessible.value for the currently focused control when I press down
> arrow. I have the following Keyboard registration
>
>
>
> Dim myDownArrow : Set myDownArrow = Keyboard.RegisterHotkey("Down
> Arrow", "OnDownArrow", ClientInformation.ApplicationProcess)
>
>
>
> In my Sub OnDownArrow() routine, I have tried the following:
>
>
>
>    Silence
>
>    Speak FocusedWindow.Accessible.Name & " is " &
> FocusedWindow.Accessible.Value
>
>
>
> However, it looks like FocusedWindow is, at this point, not the
> specific control that has focus (e.g. a List Item); rather, it seems
> to be the client window for the application.
>
>
>
> Any suggestions here? Do I need to loop through the clips and see what
> has focus or some such process as that?
>
>
>
> NOTE: The reason I am going with the RegisterCursorKey is so I can
> grab the keystroke before it is processed by the application. Simply
> connecting to the OnFocus event gets me the appropriate window but
> doesn't let me take an action before the regular process for that
> keystroke does.
>
>
>

--
To insure that you receive proper support, please include all past 
correspondence (where applicable), and any relevant information pertinent to 
your situation when submitting a problem report to the GW Micro Technical 
Support Team.

Aaron Smith
GW Micro
Phone: 260/489-3671
Fax: 260/489-2608
WWW: http://www.gwmicro.com
FTP: ftp://ftp.gwmicro.com
Technical Support & Web Development

Reply via email to