[jawsscripts] Re: functions SetVerbosityLevel and SetScreenEcho

  • From: <marquats@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Wed, 14 May 2008 14:31:33 +0200 (CEST)

Thanks for your reply Jackie McBride,

I have tried what you wrote. I realized that the functions are called
different than is documented in the fsdn.chm file. The following construct
is compiled and runs. But it has no effect on the multiple speech output:

while GetVerbosity() != ADVANCED
   VerbosityLevel()
endwhile
while GetScreenEcho() != ECHO_NONE
   ScreenEcho ()
endwhile



The whole script follows:


Include "HjGlobal.jsh" ; default HJ global variables
Include "hjconst.jsh"  ; default HJ constants
use "JAWS Braille.jsb"

Globals
Handle ZeilenLabel, ;; Handle of Label with braille output
Handle SprachLabel, ;; Handle of Label with speech output
Handle MainWin,     ;; for initialisation of the previous
string SprachSig    ;; if changed, output the speech

Void Function NewTextEvent (handle hWnd, string sBuffer,
         int nAttributes, int nTextColor,  int nBGColor,
         int nEcho, string sFrName)
var handle mainw
;; if not initialized, get Handles of labels:
if ZeilenLabel == MainWin || SprachLabel == MainWin then
   Let mainw = GetAppMainWindow(hWnd)
   If GetWindowName (mainw) == "BSLern" then ;;right application
       If sFrName == "Sprachausgabe" Then
           Let SprachLabel = hWnd
       ElIf sFrName == "Zeilenanzeige" Then
           Let ZeilenLabel = hWnd
       EndIf
   EndIf
;;NewTextEvent (hWnd, sBuffer, nAttributes,
;; nTextColor, nBGColor, nEcho, sFrName) ;; is this necessary?
EndIf
EndFunction

Void Function ScreenStabilizedEvent (Handle hWnd)
var  string labeltext,
     string zeilentext,
     string spsig
;; if initialized, get text and do output:
if ZeilenLabel != MainWin && SprachLabel != MainWin then
   Let labeltext = GetWindowText (ZeilenLabel, false)
   Let zeilentext = StringChopLeft (labeltext, 1)
   Let spsig = StringLeft (labeltext, 1)
   BrailleMessage (zeilentext, 0, 1000000)
;;;;Speech output:
   if spsig != SprachSig then
     SayMessage (OT_SCREEN_MESSAGE, GetWindowText(SprachLabel,false))
     ;;OT_JAWS_MESSAGE=3, OT_SCREEN_MESSAGE=OT_MESSAGE=4  which???
     Let SprachSig = spsig
   endif
endif
EndFunction

Void Function WindowActivatedEvent (Handle window)
Let MainWin = GetAppMainWindow(window)
Let SprachLabel = MainWin ;; to ensure correct initialisation
Let ZeilenLabel = MainWin
;; try to supress all but the explicit output done by
;;    SayMessage() and BrailleMessage() :
while GetVerbosity() != ADVANCED
   VerbosityLevel()
endwhile
while GetScreenEcho() != ECHO_NONE
   ScreenEcho ()
endwhile
EndFunction


End of script.




> Thomas:
>
> U should always put
> include "hjconst.jsh" &
> include "hjglobal.jsh"
> at the top of your script file.
> Also, why not use ctrl i to insert your functions--that way
> you're certain of correct spelling.
>
> Lastly, if these do not resolve the problem, then paste your
> code in a message & let us look at it--perhaps we can give u
> some assistance.


>> I wrote a script which outputs text appearing in two labels
>> on the program's main window. One label gives the speech output,
>> the other the braille output. I have the problem that Jaws reads
>> the speech output twice or more.
>> (I realized that the voice pitch is not always the same.
>> Some (not all) of the repetitions are said with a higher pitch.)
>>
>> ...
>>
>> I use Jaws 8.0.2173 (German version)
>> The program is self-written in C++ using Visual Studio 2005



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

Other related posts: