[jawsscripts] Schedule Function
- From: "Dean Masters" <dwmasters@xxxxxxxxxxxxx>
- To: "JAWS Scripts" <jawsscripts@xxxxxxxxxxxxx>
- Date: Wed, 15 Apr 2009 15:35:01 -0400
I have written a set of scripts and functions to read text continuously in a
Bible software program. It reads to the end of the screen then moves to the
next screen and reads from there. I got it to stop reading when i hit the
control button but then I noticed that the ScheduledFunction stil goes on at
the time alotted. so I am reading and stop the reading. After the allotted
time I hear the ScheduledFunction start and run. Here is the function where
I call the ScheduledFunction:
Void Function TopOfText ()
VAR
string LastLine,
Int iKeyWasPressed, ;use this to terminate the while loop.
string sScheme,
string sScheme1,
string sScheme2
InvisibleCursor ()
Let LastLine = GetLine (); saves first line
SayLine ();speaks first line
JAWSHome ()
NextLine ();scrols to next line
Pause ()
Let CurrentLine = GetLine ();saves new line
While (CurrentLine != LastLine && iKeyWasPressed ==0);speak if two
adjacentlines are dissimilar or if a key was pressed
Let iKeyWasPressed = IsKeyWaiting () ; set variable to true if a key was
pressed.
If iKeyWasPressed then
Return
ElIf 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
EndWhile;loop until the two lines are the same
If iKeyWasPressed then
Let sScheme = GetCurrentSchemeName ();scheme set for sounds which is to be
turned off for this script
If GetCurrentSchemeName () != "LDLS" then
Let sScheme1 = sScheme
Let sScheme2 = sScheme
Else
Let sScheme1 = "Classic"
Let sScheme2 = "LDLS"
EndIf
Let g_ChapterAndVerseToggle = 0;mutes speaking of the chapter and verse
SwitchToScheme (sScheme1);switches to the classic scheme if in LDLS scheme
Return
Else
PCCursor ()
TypeKey ("spacebar");new keystroke in Libronix 3c to go to next screen
scheduleFunction ("PositionForNextRead", 200)
EndIf
EndFunction
How can I keep the ScheduledFunction from running when I want to stop
reading?
Thanks,
Dean
__________
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: