[nfbcs] solved (sort of): jaws13 echos entire line in command window apps

John G. Heim jheim at math.wisc.edu
Wed Nov 7 17:56:37 UTC 2012


All, 

We had a little discussion here recently about jaws13 echoing the entire
line as you type in a command window. Below is a jaws script that kind of
solves the problem. It really is only for ssh windows because most of the
code turns off echo of password fields. This works by looking for a colon
(:) on your current line in the command window. If the line ends in a colon,
it turns off key echo. At the time it didn't occur to me that this might
have side-effects. If I get around to fixing it, I'll post an update.  In
the mean time, this code works pretty well for both fixing the line echo
problem and for not echoing passwords as you type them in. It should work
for any command window ssh client.

To install, open your ssh client, press insert+0 to run the jaws script
editor, paste in the code below, and close the script editor saving your
changes in the process.

--- cut here ---
include "hjconst.jsh"
include "hjglobal.jsh" 

Globals
int nCommandLine


Script ScriptFilename ()
	ScriptAndAppNames ("openSsh") ; Announce that the SecureCRT settings
are active
EndScript

Void Function AutoStartEvent () 
;	SayString ("Welcome to openSsh") 
; Don't re-read window title
	SpeechOff () ; Turn the speech off
	Pause () ; Let NewTextEvent do its job (silently)
	SpeechOn (); Turn the speech back on
	SayLine ()	
	setJCFOption(OPT_Typing_Echo, 0)
	EndFunction 

Void Function KeyPressedEvent (int nKey, string strKeyName, int
nIsBrailleKey, int nIsScriptKey) 
	If (strKeyName == "tab") Then
		Let nCommandLine = False
	Else
		Let nCommandLine = true
	EndIf
	if (strKeyName == "enter") Then
		setJCFOption(OPT_Typing_Echo, 0)
Let nCommandLine = False
	Else
		If (getJCFOption(OPT_Typing_Echo) == 0) Then
			If (Not isPassWordPrompt()) Then
			setJCFOption(OPT_Typing_Echo, 1)
EndIf
		EndIf
	EndIf
endFunction

int Function isPasswordPrompt()
	Var Int nChar
	SaveCursor()
	InvisibleCursor() ; Activates the Invisible cursor 
	RouteInvisibleToPC() ; Move the Invisible cursor to the PC cursor so
it is in the correct window. 
	PriorCharacter()
	Let nChar = GetCharacterValue(GetCharacter())
	While (nChar == 32)
		PriorCharacter()
		Let nChar = GetCharacterValue(GetCharacter())
	EndWhile	
	RestoreCursor()
	If (nChar == 58) Then
		Return True
	Else
		Return False
	EndIf
	EndFunction

int function NewTextEventShouldBeSilent(handle hFocus, handle hwnd, string
buffer, int nAttributes, int nTextColor, int nBackgroundColor, int nEcho,
string sFrameName)
	If (nCommandLine) Then
		Return True
	EndIf
	return NewTextEventShouldBeSilent(hFocus, hwnd, buffer, nAttributes,
nTextColor, nBackgroundColor, nEcho, sFrameName)
	endFunction




More information about the NFBCS mailing list