[jawsscripts] Re: repost of dean's problem re ScheduleFunction not Working

  • From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 10 Mar 2009 15:30:41 -0400

I initially responded to Dean's post and suggested that he use the
ScheduleFunction in his TopOfText function.  

From my original message:
The timing issue you mention could be rectified if you used the
ScheduleFunction to run a function that contained the code from your
function which came after the press of the space bar.  This of course
will have the effect of breaking your TopOfText function in to two
functions.  You will need to make any variable that was defined in the
TopOfText  function that is used in the new function a global variable
so that it's value can be read in the new function.  This will allow you
to increase the time before this function is called to an appropriate
amount.

His problem is not really the ScheduleFunction so much as it is a
problem of having two while loops running simultaneously.

In his ReadContinuously script he sets up some variables for schemes
and other things, then he runs his TopOfText function.  So far so good.

In his TopOfText function he activates the Jaws cursor, loads a couple
of string variables to hold the current line and last line. and sets up
a variable which will become true if a key is pressed during the while
loop in this function.

Now while loop runs until key is pressed or until last line and current
line are equal.
He needs to remove the following lines from his TopOfText function in
the while loop:
If iKeyWasPressed then
Return

This causes control to go back to the script that called TopOfText
Immediately.  His loop will not be entered again after the key was
pressed so the return is not necessary here. 
He checks for this condition immediately after the EndWhile for his
loop.
He could use the following if in his while loop.
If iKeyWasPressed ==0 then

SayLine ()

Let LastLine = CurrentLine; sets up for new comparison

NextLine ();scrolls down one line

Let CurrentLine = GetLine (); saves the new line

EndIf
 
After the while loop ends he checks the value of the iKeyWasPressed and
returns if this is true.

I suggest that he changes the schemes as appropriate in this if and set
up the Reading of verses as appropriate here before returning.  much of
this code already exists in his ReadContinuously script.
So the rest of his TopOfText function could look something like this:

If iKeyWasPressed then
set up schemes and verse reading etc. 

Return

Else

PCCursor ()

TypeKey ("spacebar");new keystroke in Libronix 3c to go to next screen

scheduleFunction ("PositionForNextRead", 2)

EndIf

EndFunction
His new PositionForNextRead function would contain the rest of the
Lines taken from the TopOfText function:
Void function PositionForNextRead ()

Say ("next page", ot_status, false); for testing purposes

JAWSCursor ()

If FindString (GetFocus (), CurrentLine, s_bottom, s_restricted) then

NextLine ()

Else

JAWSPageUp ()

JAWSHome ()

EndIf

RefreshWindow (GetCurrentWindow ())

TopOfText()

EndFunction

Doing things this way means that you no longer need to use another
while loop in the ReadContinuously function because the topOfText
function is called again in the PositionForNextRead function.

As I mentioned previously, this approach will require a few new global
variables.  The while loop in the ReadContinuously function should be
removed and the schemes etc. can be set up again in the TopOfText
function.

That's my take on it for what it's worth.

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 

>>> "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx> 01:37 am Sunday, March 08,
2009 >>>
Hi list, I thought I'd just rePost Dean's issue since I hadn't seen
any
responses to it yet, and hoped that a reminder might help if anyone has
time
to take a look?

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