[jawsscripts] Re: try to write script for self-written program

  • From: "Tony Hernandez" <tony@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 2 May 2008 12:39:22 -0400

HI Thomas.

I don't know about the double speaking, but I do have a suggestion for the
braille input issue.  Try using the IsKeyWaiting function.  I think that
determines whether there is a key still being held down.  If it does the
opposite, you can negate it with the exclammation point.  I'm not sure which
way would work, but I'm confident that's the function you need.

Tony Hernandez:  SpeaksClan Patriarch
http://www.tonyspeaks.com
http://www.speaksclan.net
Study at home to work from home. Become a medical transcriptionist.
http://www.homecareerinfo.com/0879

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of
marquats@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Friday, May 02, 2008 9:02 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] try to write script for self-written program

Hello,

I'm maintaining a program that teaches braille and uses Jaws for speech- and
braille output. I'm unexperienced with scripting and don't get along.

The program is a windows forms application. On the main window there are two
labels. One contains the speech output, the other the braille output and a
signal character to tell Jaws to re-read the first label.
The script uses ScreenStabilizedEvent() to read the 2nd label and do the
braille output, and if the signal character has changed, it also says the
text on the first label.

This mechanism works so far, but Jaws reads the speech output twice or more
in most cases, and I don't understand why.
I have re-written the NewTextEvent() function, so that it doesn't read any
new text (at least this is my intention). Output is only done in
ScreenStabilizedEvent.

I would appreciate any help. I tried different versions of the script, but
without success. I have also tried to call SetVerbosityLevel and
SetScreenEcho, but I get an error message "call to unknown function ...".


The second problem I have to solve is the braille input. The user shall
enter braille with the 8 braille keys on the braille display. How can I pass
this input to the program? I found out that KeyPressedEvent() is called
every time the user presses a key, including the braille keys. But I have to
determine when the user has released all keys; then a braille pattern is
entered.

Thanks very much for any kind of help,
Thomas Marquardt


PS:
I'm using a 40 minute version of Jaws 8.0 and Windows XP.
The program is written with Visual Studio 2005.
I currently use Handytech Braillestar 40, but I can only sometimes have the
braille display to try things out.

The script follows:



Include "hjconst.jsh"
use "JAWS Braille.jsb"

Globals
Handle ZeilenLabel, ;; label with braille output Handle SprachLabel, ;;
label with speech output Handle MainWin, string SprachSig

Void Function NewTextEvent (
  handle hWnd,       ;Handle of window with text that was written
  string sBuffer, int nAttributes, int nTextColor,
  int nBGColor, int nEcho, string sFrName) ;;determine the handles of the
labels:
var handle mainwi
if ZeilenLabel == MainWin || SprachLabel == MainWin then
   Let mainwi = GetAppMainWindow(hWnd)
   If GetWindowName (mainwi) == "BSLern" then
       If sFramename == "Sprachausgabe" Then ;;Label with speech output
           Let SprachLabel = hWnd
       ElIf sFramename == "Zeilenanzeige" Then ;;Label with braile output
           Let ZeilenLabel = hWnd
       EndIf
   EndIf
EndIf
EndFunction

Void Function ScreenStabilizedEvent (Handle hWnd) var  string labeltext,
     string zeilentext,
     string spsig
if ZeilenLabel != MainWin then
   Let labeltext = GetWindowText (ZeilenLabel, false)
   Let zeilentext = StringChopLeft (labeltext, 1)
   Let spsig = StringLeft (labeltext, 1) ;; signal character
   BrailleMessage (zeilentext, 0, 1000000) endif ; Speech output:
if spsig != SprachSig && SprachLabel != MainWin then ;;if signal changed
    SayMessage (OT_SCREEN_MESSAGE, GetWindowText (SprachLabel, false)) Let
SprachSig = spsig endif EndFunction

Void Function WindowActivatedEvent (Handle window) Let MainWin =
GetAppMainWindow(window) Let SprachLabel = MainWin ;initialize, to make sure
that the output is Let ZeilenLabel = MainWin ;done only if the handles are
determined right EndFunction



__________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts

No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.7/1409 - Release Date: 5/1/2008
8:39 AM
 

No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.7/1409 - Release Date: 5/1/2008
8:39 AM
 

__________ 
View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: