[jawsscripts] Re: Left mouse button on the next item in a list

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 25 Dec 2008 12:58:20 -0500

This scenario is similar to an issue this list solved for me.  I solved the
problem using  (actually adding to/overriding)the ActiveItemChangedEvent
event function.  This approach should eliminate the need for any additional
keystrokes other than the normal navigation keys (arrow, Home,  and End
keys).  It was suggested that to make this work, the following line should
be added to the Options section of the application's JCF file:
MSAAMode=2

Below is my version of this function.  Notice that in my version, I decided
not to pass this function down the chain for a default or built in function
to process, when in that list.  It returned the wrong number of items in the
list, so I made it speak what I wanted.  Note the parameter, iCurrentChild,
is actually the selected item in the list.

Void Function ActiveItemChangedEvent (handle hWnd, int iCurrentID, Int
iCurrentChild, handle hWndPrevious, Int iPreviousID, Int iPreviousChild)

If hWnd == ghWndListView Then
 SayString ("Item " + IntToString (iCurrentChild))
 If GetCharacterAttributes () & ATTRIB_BOLD Then SayString ("new ") EndIf
 ; SayString ("Selection state = " + IntToString (lvGetItemState (hWnd,
iCurrentChild) ))
 SayObjectActiveItem (False)
 SayString (IntToString (iCurrentChild) + " of " + IntToString
(lvGetItemCount (ghWndListView)))

 JAWSCursor ()
 RouteJAWSToPc () ; move JAWS cursor to item to activate custom ToolTip to
capture phone number in WindowActivatedEvent
 LeftMouseButton () ; select item
 PCCursor ()
Else
 ; Most likely in a JAWS dialog
 ; SayString ("Call to item changed and not in list view!  Item = " +
IntToString (iCurrentChild))
 ActiveItemChangedEvent (hWnd, iCurrentID, iCurrentChild, hWndPrevious,
iPreviousID, iPreviousChild)
EndIf

EndFunction


I got most of the inspiration from David Farough.  Below are some great 
ideas
that might apply to your situation:
"To expand a bit on what Jim has suggested, you could use the
setJcfOption function to specify whether the JawsCursor is tethered to
the pc cursor.
If this is turned on, the jawsCursor will follow the pc cursor.  This
might insure that you hear the contents of the tooltip when you move
from item to item in the list.

this entry is stored in the .jcf file of your application.
I took the following lines from my default.jcf file.
; 1=JAWS cursor is tethered to the Pc cursor, i.e.,
; whenever the Pc cursor moves, the JAWS cursor will follow it.
; 0=JAWS cursor is indifferent to Pc cursor movements,
; which has been the traditional behaviour
TetherJAWSToPC=0

therefore, you could use the following line to make the Jaws cursor
follow the pc cursor when the listview gets the focus.
SetJCFOption (OPT_TETHER_JAWS_TO_PC, 1)
If desirable you could turn this off when you leave the listview.
for other constants that can be used in the SetJcfOption function refer
to the hjconst.jsh file.  These constants all begin with either Opt_ or
Optbrl_.

with regard to the selecting of list items:
look at the fsdn  document under dialog controls.  there are a number
of items which all begin with lv  Several of these could be useful.

The next thing you will need to do is find out where to place your
alternative functionality and what conditions should apply when using
this code.

I suggest taking a look at the ActiveItemChangedEvent function.
this might be a good place to specify any alternative processing when
moving through a listview."
from David Farough

Don Marang


----- Original Message ----- 
From: "Andy Borka" <andy@xxxxxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Thursday, December 25, 2008 9:58 AM
Subject: [jawsscripts] Re: Left mouse button on the next item in a list


> Hi.
>
> When I take out TypeKey("down arrow") and reassign the script hotkey to
> control +d and then run it, this is what happens:
>
> 1. Go to the problematic listview.
> 2. Press home to make sure I am at the top of the list.
> 3. Press down arrow once followed by control+d to activate the script.
>
> The result is that the highlight bar moves down x number of down arrow
> presses. What I am trying to do with the script is to be able to down
> arrow and expect that the highlight bar would move with the down arrow.
> If this can be done with Jaws then it would be good since there is no
> other hope for the listview. Is there a way to do this? It looks like
> I'm close since I can do it like this so far.
>
>
> Martin Slack wrote:
>> Hi Andy,
>>
>>   Firstly I would say that the line:
>>
>> TypeKey("down arrow")
>>
>> in your script isn't actually doing anything.  I understand that you have
>> to
>> use the exact form of words that FS has prescribed as a key name, and in
>> this case, it doesn't include a space, and has both sub-words
>> capitalised.
>> Like so:
>>
>> TypeKey("DownArrow")
>>
>>   However, the fact that the script is working must mean that it is the
>> down
>> arrow key activating the script that is causing the pc cursor "highlight"
>> to
>> move down.
>>
>>   What happens if you press the down arrow key the appropriate number of
>> times, then use control+shift+some other key to call your script (without
>> the final TypeKey line) ?
>>
>>   Martin
>>
>>
>> ----- Original Message ----- 
>> From: "Andy Borka" <andy@xxxxxxxxxxxxxxxxxxx>
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Sent: Thursday, December 25, 2008 8:51 AM
>> Subject: [jawsscripts] Left mouse button on the next item in a list
>>
>>
>>
>>> I need to left mouse button on the next item in a list because the
>>> highlight bar doesn't move with the pc cursor in a listview. I have the
>>> following script that works when using control windows downarrow, but I
>>> have to press control windows down arrow each time I want to go down in
>>> the list. Is there a way to make it do this but be able to hold down the
>>> control windows combo and then just hit the down arrow to move in the
>>> list?
>>>
>>> Script MoveDownInCalendarEventList ()
>>> PCCursor ()
>>> RouteJAWSToPc ()
>>> LeftMouseButton ()
>>> PCCursor ()
>>> TypeKey("down arrow")
>>> EndScript
>>>
>
>
> __________
> 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
>

__________ 
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: