[jawsscripts] Re: Skipping screen
- From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
- To: "JAWS Scripts" <jawsscripts@xxxxxxxxxxxxx>
- Date: Thu, 19 Feb 2009 11:29:13 -0500
Hi Dean:
first a few questions.
What does pressing the spacebar do? does it move to the next page?
What does PCToText () do?
Also, Is it really necessary to refresh the window for each line
within the while loop?
Doing this so often will cause a sort of flashing effect and may also
trigger other events. minimizing this would be helpful.
I also noticed within the TopOfText function that you activated the
Jaws cursor at one point, and then activated the jaws cursor again
within an if condition. this could cause the invisible cursor to be
activated, since performing two Jaws cursors within a short period of
time will activate the Invisible cursor instead. I will copy the lines
I am referring to below.
PCCursor ()
TypeKey ("spacebar");new keystroke in Libronix 3c
Pause ()
JAWSCursor ()
If FindString (GetFocus (), CurrentLine, s_bottom, s_restricted) then
JAWSCursor ()
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.
I will copy the ScheduleFunction entry from the fsdn below.
HTH
Function: ScheduleFunction
Description
Runs a user defined function in a set period of time. Useful when you
want to perform a task and then check on the results at a later time.
Once this function is used, you can call UnScheduleFunction to cause the
user-defined event not to run.
Returns
Type: Int
Description: An ID that can be used to call UnScheduleFunction. If 0 is
returned, then the timer was not successfully set.
Parameters
Param 1:
Type: String
Description: Name of function to be executed.
Include: Required
Param 2:
Type: Int
Description: Amount of time to elapse before the function is executed.
Time is measured in tenths of a second. A value of 10 is one second.
Include: Required
Version
This function is available in the following releases:
PAC Mate 1.10 and later
JAWS 4.51 and later
Magic 10.5 and later
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
>>> "Dean Masters" <dwmasters@xxxxxxxxxxxxx> 04:52 pm Wednesday,
February 18, 2009 >>>
I am trying to get the combination of the two following to read a
screen of
text then move to the next screen and red it, etc. It wil read the
first
page then repeat the last line which may be the first line of the next
page.
It might read another line or two then skip to the next screen. Does
anyone
know why it might be skipping? It seems like the movement between
screens is
faster than JAWS can read the screens. Is there any way to slow this
down
without using the delay function:
Void Function TopOfText ()
VAR
String CurrentLine,
string LastLine,
Int iKeyWasPressed ;use this to terminate the while loop.
JAWSCursor ()
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
Else
SayLine ()
Let LastLine = CurrentLine; sets up for new comparison
JAWSHome ()
NextLine ();scrolls down one line
RefreshWindow (GetCurrentWindow ());needed for some Bibles
Pause ()
Let CurrentLine = GetLine (); saves the new line
EndIf
EndWhile;loop until the two lines are the same
If iKeyWasPressed then
Return
Else
PCCursor ()
TypeKey ("spacebar");new keystroke in Libronix 3c
Pause ()
JAWSCursor ()
If FindString (GetFocus (), CurrentLine, s_bottom, s_restricted) then
JAWSCursor ()
NextLine ()
Else
JAWSPageUp ()
JAWSHome ()
EndIf
EndIf
EndFunction
Script ReadContinuously ()
VAR
string CurrentPage,
string LastPage,
string sScheme,
string sScheme1,
string sScheme2
Let sScheme = GetCurrentSchemeName ()
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
PCToText ()
JAWSCursor ()
RefreshWindow (GetCurrentWindow ())
Pause ()
Let LastPage = GetWindowText (GetFocus (), false);saves Current page
TopOfText ();speaks screen of text then scrolls to the next page
Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
While (CurrentPage != LastPage) ;speak if two concurrent pages are
dissimilar
Let LastPage = CurrentPage;sets up comparison
TopOfText ()
Pause ()
Let CurrentPage = GetWindowText (GetFocus (), false);saves new page
EndWhile;loop until the two pages are the same
Say ("That's all folks!", ot_status, false);for testing purposes
SwitchToScheme (sScheme2) ;Switches back from classic to LDLS scheme
Let g_ChapterAndVerseToggle = 1;turns on speaking of chapter and verse
EndScript
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
__________
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: