[jawsscripts] Re: Passing Keystrokes to another application

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 25 Apr 2009 00:38:49 -0400

I did take a look at this app with WinDig.  I found over half a dozen 
windows in WinDig that were associated or spun off by  DIRECTV2PC.  There 
were 2 "active movie" windows, a DirecTV2PC window, several DDE windows, 
etc...  None of these elements had much in them except the System menu and 
invisible horizontal and vertical scrollbars.  Being able to get direct 
access to the menus would be cool, ut I did not expect that.  The menus are 
far from standard MS Windows.  In fact, they are designed to look and 
function exactly like the menus on the TV.  More importantantly, I was 
hoping to get access to the raw data from the object providing information 
for the "My Playlist" of recorded movies.  On screen, this list appears in a 
list similar to a tree view.  Shows that are scheduled to record all season 
are presented in a collapsed folder type manner.  Perhaps it is due to the 
design goal to make the interface mimic the TV screen, or the need to 
protect the video from being captured, but nothing seems to be available to 
JAWS.

Assuming that the application is coded in an object oriented language, is it 
difficult to expose the objects related to the user interface through MSAA? 
I would like to push CybrerLink and DirecTV to make this app more accessible 
while it is still in beta.

Don Marang


----- Original Message ----- 
From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Friday, April 24, 2009 10:32 AM
Subject: [jawsscripts] Re: Passing Keystrokes to another application


> Hi Don:
> I'm glad that worked for you.  Yes the blink when the window gets focus
> is unavoidable in this case.  It just occurs to me that you might have
> another option.
> if you do not already have a copy you should go to Jamal's site and
> download WinDig.  If you are lucky maybe this program will be able to
> provide you a menu id for each of these commands.  If so, you could use
> the SendMessage function to perform the commands you want.  You would
> pass the handle of the main window and the menu id of the command in
> question.  If you can retrieve the necessary menu IDs for the commands
> you are interested in, you would not actually have to change the focus
> before performing this functionality.
> you can download windig from:
> http://www.empowermentzone.com/wdsetup.exe
>
> I will include below a post that Jamal sent to the list some time ago
> which describes this technique.
>
> In the "Menus" section of WinDig output, the last piece of data on the
> line for a menu item is its menu ID--if one exists.  If a menu item
> does
> not have a hot key but does have a menu ID, you can create a hot key
> via a
> JAWS script and the SendMessage function.  For example, the following
> line
> of WinDig output is about the Paste Special menu item of WordPad:
>
> 2.5 Paste Special... S 57639
>
> The 2.5 number is the outline number of the menu hierarchy, indicating
> that the menu item is the fifth one down the second menu, the Edit
> menu.
> The ... ellipses indicate that the menu item presents a dialog.  S is
> the
> access letter, indicating that you can press it when the Edit menu is
> dropped down to invoke this menu item.  Finally, the 57639 number is
> the
> menu ID, similar to a control ID.
>
> This review of the WinDig output for WordPad showed no accelerator key
> for
> PasteSpecial but a menu ID was available.  I am not suggesting that
> scripts are needed for every menu item without a hot key--this is just
> to
> illustrate the technique, and you would judge whether such a script
> adds
> significant value in the context of the application.
>
> Although it is also possible to invoke a menu item by sending
> keystrokes
> to the application, that technique is less reliable because it is
> affected
> by the current keyboard focus.  It also tends to produce extra speech
> which you may then need to silence with SpeechOff and Delay functions.
>
> The SendMessage approach, on the other hand, does not actually
> activate
> and navigate the menus of the application's user interface.  It uses a
> Windows message constant, WM_COMMAND, which is passed with a menu ID
> to
> the application window associated with the menu of interest.  The
> relevant
> window handle is usually the one returned by GetAppMainWindow, but the
> InvokeMenuItem wrapper function below does not assume this in case you
> wish to use another window, including a window of an application other
> than the one with focus.
>
>  The code below consists of a generic function called InvokeMenuItem,
> and
> a sample script called PasteSpecial, which might be attached to
> Control+Shift+V. Note that a limitation of this approach is that it
> only
> works if the application implements standard menus of the Win32 API.
> Unfortunately, many applications do not, such as those in the
> Microsoft
> Office suite.
>
> Jamal
>
>
> Int Function InvokeMenuItem(Handle h, Int i)
> Var
> Int WM_COMMAND
>
> Let WM_COMMAND = 273
> Return SendMessage(h, WM_COMMAND, i, 0)
> EndFunction
>
> Script PasteSpecial()
> Var
> Handle h,
> Int i
>
> Let h = GetAppMainWindow(GetFocus())
> Let i = 57639 ; menu ID of Paste Special in WordPad
>
> InvokeMenuItem(h, i)
> EndScript
>
>
>
> David Farough
> Application Accessibility Coordinator/coordonateur de l'accessibilité
> Information Technology Services Directorate /
> Direction des services d'information technologiques
> Public Service Commission / Commission de la fonction publique
> Email / Courriel:  David.Farough@xxxxxxxxxxxxx
> Tel. / Tél:    (613) 992-2779
>
>>>> "Donald Marang" <donald.marang@xxxxxxxxx> 09:29 pm Thursday, April
> 23, 2009 >>>
> Thanks David,
>
> Works great!  Of course the video screen blinks when setting the focus
> to
> the full screen window behind the video window.  Perhaps, I can use
> this
> trick on my Verizon application as well, where I have trouble reliably
>
> switching back from the SignIn helper application.
>
> Don Marang
>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
> 

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

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

Other related posts: