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.