[jawsscripts] Re: Focus issue with jaws

I have a few comments about the functions that you have written.

First of all, you should be careful to include all the required
parameters for these functions.
In Your SayNonHighlightedText function, you did not include the handle
and string parameters for this function. Your function declaration
should have looked like this:
void Function SayNonHighlightedText (handle h, string buffer)

You also need to consider that many other conditions and situations may
exist which will cause your function to run.  It is important to
determine what these situations are and test for them and perform the
necessary actions.

If you are coding an alternative version of default Jaws functions, You
should always call the default version of that function before you end
your function.  This will insure that the Jaws default functionality
will continue to happen in situations where your functionality was not
performed.

I will include your SayNonHighlightedText function below and add the
call to the default version at the end.
void Function SayNonHighlightedText (handle h, string buffer)
var 
Handle HWnd,
int iControl
Let hwnd = GetFocus ()
let iControl = GetControlID (hwnd)
If (iControl == 27 ) then
Return
EndIf
SayNonHighlightedText (h, buffer)
EndFunction

Notice, that when you call the default version of the function at the
end, that you do not include the parameter types before the variables
that you are passing to the default version of your function.  All you
need to do is to specify the variable names in the correct order to the
function.

Finally, be careful not to do things unconditionally that will modify
the focus.

In Your SayHighlightedeText function, you set the value of the hwnd
variable that was passed to the function to the value of the window that
had the focus.
It would be much safer to create a local variable in this function to
hold that value.  You could then determine the control id and perform
your processing and then call the default version of this function with
the unmodified handle so that the default functionality was not
changed.
>>> "Arya" <brk339999@xxxxxxxxx> 07:08 am Thursday, November 20, 2008
>>>
Hello  Friends,
I am trying to script an application, but I face a  focus issue with
jaws.
When I press the applications menu , the menu pops up , jaws reads out
the item in the menu, along with the
items in the previous window.
I  paste the code below , which doesn't seem to work.
Please, help me to solve the problem.
Include "HjGlobal.jsh" ; default HJ global variables 
 Include "hjconst.jsh" ; default HJ constants 
 Void Function SayHighlightedText (handle hwnd, string buffer, int
nTextColor)
var 
int iControl
Let hwnd = GetFocus ()
let iControl = GetControlID (hwnd)
If (iControl == 0 ) then
Return
EndIf
EndFunction


Function SayNonHighlightedText ()
var 
Handle HWnd,
int iControl
Let hwnd = GetFocus ()
let iControl = GetControlID (hwnd)
If (iControl == 27 ) then
Return
EndIf


EndFunction


 
 Visit.
http://www.ultrauniverse.co.cc 
Experience the ultimate!, beyond borders. 

__________ 
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 


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