[jawsscripts] Re: do not echo passwords in ssh

  • From: Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 19 Oct 2012 22:21:02 -0400

Ah, I worded a few things badly there I think...

First of all, by "field" I did not mean a separate control but just a
place after a name, like "Password:"

And by telling you to set Key Echo to None, I was figuring you'd do it
in the script, not manually every time you entered the Password field:

setJCFOption(OPT_Typing_Echo, Echo_None)

The problem, then, is knowing how to script that to occur when you
want it to.

Here's a function (with supporting code) for doing the silencing
from KeyPressedEvent. This is the way I've done it in projects:
From KeyPressedEvent, figure out when a printable key has been typed
from within a field to silence, and call what in this file I named
sk__silence() to silence the keystroke.


; Function for silencing key echo in password fields in terminal applications.
;
; Interface:  Call sk__silence from KeyPressedEvent each time a
; character is typed into a password field.
;
; Author:  Doug Lee

; Revision History (see also version control logs):
;       06/05/02:  Module written and submitted to the JAWS script list.
;       02/06/03:  Internal function renamed to hide it.
;       03/04/03:  Rewritten to avoid failure when the scheduled echo restore 
did not execute.
;       12/01/03:  Module brought under CVS control as part of BX.

globals
        int sk___oldKeyEcho

void function sk___restore()
; Restores the original Typing Echo setting saved by sk__silence.
; Scheduled via scheduleFunction by sk__silence.
if sk___oldKeyEcho then
        setJCFOption(OPT_Typing_Echo, sk___oldKeyEcho)
endIf
let sk___oldKeyEcho = 0
endFunction

int function sk__silence(int sayStar)
; Call from KeyPressedEvent on each key which should be silenced.
; Pass True for sayStar if you want "star" to be spoken for the key;
; otherwise, there will just be silence.
; Returns True if the key is successfully being silenced, and False otherwise.
; Note: When speaking stars, each character will cause "*" to be spoken
; immediately, even if the Typing Echo mode was Words.
if !sk___oldKeyEcho then
        let sk___oldKeyEcho = getJCFOption(OPT_Typing_Echo)
endIf
if !scheduleFunction("sk___restore", 0) then
        return False
endIf
setJCFOption(OPT_Typing_Echo, 0)
if sayStar then
        sayMessage(OT_No_Disable, "*")
endIf
return True
endFunction


On Fri, Oct 19, 2012 at 04:35:44PM -0500, John Heim wrote:
Of course, I already know I can change ktyping echo setting by pressing
insert+f2. I don't want to have to do that every time I need to enter a
password. In fact, you have to press it three times  to set it to none and
then you have to press it yet again to turn it back on.  

The cursor is not in a field. This is a command window like the old
Hyperterminal  program or like the Terminal app on a Mac. Or like the Win7
command window. 
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
Sent: Friday, October 19, 2012 3:58 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: do not echo passwords in ssh

That should be possible just by setting key echo to None. If you want it
field-specific, you'll have to write code that figures out what field the
cursor is in and adjusts that setting accordingly. Years ago I also put out
a "squelch" module that made JAWS say "star" for the characters typed in
fields against which the module is applied. I believe that approach used the
KeyPressedEvent and speechOff or stopSpeech or something like that to get
the job done.

Of course turning Key Echo globally off will lose you more key speech than
you had in mind, and even if you script a way to make displayed typed
characters speak, chances are this combination will cause a sluggish feel -
delayed key echo, sometimes echo of several keys at once as part of a
pronounced word, etc. So if I were doing this, I would want it to be
field-specific, even though that's more work.

Hth.

On Fri, Oct 19, 2012 at 02:19:12PM -0500, John Heim wrote:
Hi,

I would like to write a script for openSsh for Windows that will keep jaws
from speaking the characters I type while entering passwords. It should be
easy to do because the character will not appear on the screen.  If the
cursor doesn't move or if the terminal program, openSsh in this case, does
not echo the character back to the screen, jaws should not speak it.




__________???

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

--
Doug Lee, Senior Accessibility Programmer SSB BART Group -
Accessibility-on-Demand mailto:doug.lee@xxxxxxxxxxxxxxxx
http://www.ssbbartgroup.com "While they were saying among themselves it
cannot be done, it was done." --Helen Keller __________o?=

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


__________???

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

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________�

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

Other related posts: