[nfbcs] odd jows behavior in command window

Doug Lee dgl at dlee.org
Thu Sep 27 15:38:18 UTC 2012


Probably a suboptimal way to provide these, but here are scripts I run
while in Cygwin to help with the arrows-read-wrong-stuff issue. Cut
between lines of equal signs, put in a script file that either loads
natively or is loaded via a ConfigNames.ini line, and compile. Make
sure lines do not wrap.

========== start script code ==========
; General terminal scripts.
;
; Author: Doug Lee

include "hjconst.jsh"
;#pragma StringComparison partial

globals
	object gt___cursor,
	int gt___lastTick

script scriptFileName()
scriptAndAppNames("General terminal")
endScript

object function gt___getCursor()
; Retrieves the MSAA caret object unconditionally.
var
	int childID
; -8 is ObjID_Caret
return getObjectFromEvent(getFocus(), -8, 0, childID)
endFunction

int function gt__getCursor()
; Sets gt___cursor to the MSAA caret object.
; Uses a cache to minimize MSAA calls.
; Returns True on success and False on failure.
if gt___cursor then
	if gt___cursor.accRole(0) then
		if getTickCount() -gt___lastTick <= 1000 then
			return True
		endIf
	endIf
endIf
let gt___cursor = gt___getCursor()
if gt___cursor then
	if gt___cursor.accRole(0) then
		let gt___lastTick = getTickCount()
		return True
	endIf
endIf
return False
endFunction

int function findCaret(int byRef x, int byRef y)
; Tell JAWS where the PC cursor is, if JAWS can't find it.
; JAWS calls this function when it fails to figure this out for itself.
; Warning: Code in this function can run 40 or more times in one second.
var
	int childID,
	int left, int top, int width, int height
if gt__util__isSpecialFocus() then
	return findCaret(x, y)
endIf
if gt__getCursor() then
	let childID = 0
	gt___cursor.accLocation(intRef(left), intRef(top), intRef(width), intRef(height), childID)
	if !left && !top && !width && !height then
		return findCaret(x, y)
	endIf
	let left = left +1
	let top = top +1
	let x = left +(width/2)
	let y = top +(height/2)

	saveCursor() invisibleCursor() saveCursor()
	moveTo(x, y)
	priorCharacter()
	nextCharacter()
	let x = getCursorCol()
	let y = getCursorRow()
	return True
endIf
return findCaret(x, y)
endFunction

int function gt__notThisApp(handle hwnd)
; Returns True if hwnd appears not to be part of the focused application.
if getTopLevelWindow(hwnd) != getTopLevelWindow(getFocus()) then
	return True
endIf
return False
endFunction

void function sayNonHighlightedText(handle hwnd, string buffer)
var int screenEcho = getScreenEcho()
if screenEcho == Echo_None then
	sayNonHighlightedText(hwnd, buffer)
	return
endIf
if gt__util__isSpecialFocus() ||screenEcho == Echo_All || getObjectSubtypeCode() then
	sayNonHighlightedText(hwnd, buffer)
	return
endIf
if hwnd != getFocus() then
	; Don't speak out-of-app text as it changes.
	return
endIf
; Normally we'd chain a sayNonHighlightedText call here,
; but in non-console terminal apps like Tera Term Pro, this fails.
sayMessage(OT_Screen_Message, buffer)
endFunction

void function sayHighlightedText(handle hwnd, string buffer)
if hwnd != getFocus() then
	; Don't speak out-of-app text as it changes.
	return
endIf
sayHighlightedText(hwnd, buffer)
endFunction

void function sayLine(int iDrawHighlights)
; Make up and down arrows less likely to read the wrong line.
if !gt__util__isSpecialFocus() && stringContains(stringLower(getCurrentScriptKeyName()), "arrow") then
	pause()
endIf
sayLine(iDrawHighlights)
endFunction

int function gt__util__isSpecialFocus()
; Returns True if there is a special condition for which normal focus handling should not apply.
; Currently, the conditions that are considered special are menusActive, userBufferIsActive, inHJDialog, and switchingTasks (Alt+Tab is active).
return menusActive() ||userBufferIsActive() ||inHJDialog() || gt__util__switchingTasks()
endFunction

int function gt__util__switchingTasks()
; Returns True if the user is currently Alt+Tabbing between tasks.

; This approach is adapted from JAWS 9.0.2169's default.jss FocusChangedEventEx function.
if getWindowClass(getFocus()) == "#32771"
&& getObjectTypeCode()== WT_LISTBOXITEM then
	return True
endIf
return False
endFunction

========== end script code ==========

On Thu, Sep 27, 2012 at 10:21:39AM -0500, John G. Heim wrote:
Great minds think alike I guess. The reason I asked for confirmation of this
problem is that Freedom Scientific says they cannot reproduce the bug. Of
course, they always say that. I suppose I shouldn't criticize Freedom
Scientific's tech support. Compared to your typical technology company,
Freedom Scientific's support is first rate. Still, its annoying that every
time I've reported a bug, they say they cannot reproduce it. There have been
times when I have reported bugs that were confirmed by 5 or 6 other jaws
users. Yet they say they can't reproduce it.

Anyway, Cygwin essentially runs in a command window. In fact, the real
reason I reported the command window bug was that openSsh, which is related
to Cygwin, also has this bug. I don't think there is much point in reporting
a bug for Cygwin or openSsh. They are just going to say they don't support
those apps. But looks as if this bug effects all Win 7 command window apps
and I'm thinking if we get them to fix the bug for the command window, it
will automatically fix Cygwin and openSsh.

-----Original Message-----
From: nfbcs-bounces at nfbnet.org [mailto:nfbcs-bounces at nfbnet.org] On Behalf
Of Nicole B. Torcolini Home
Sent: Tuesday, September 25, 2012 7:56 PM
To: 'NFB in Computer Science Mailing List'
Subject: Re: [nfbcs] odd jows behavior in command window

I don't use the Windows 7 command prompt, but JAWS 13 and Windows 7 with
Cygwin does the exact same thing. The two other extremely annoying problems
that I experience are that, if you edit in the middle of a line, JAWS reads
the entire line every time that you type or erase a character, and, when
reading character by character, JAWS is always one character off. Maybe
those of us who use JAWS with command prompt on a regular bases need to get
together to make a list of bugs and put them in some kind of formal letter
to Freedom Scientific.

Nicole and JAWS the talking shark that does not behave

-----Original Message-----
From: nfbcs-bounces at nfbnet.org [mailto:nfbcs-bounces at nfbnet.org] On Behalf
Of John G. Heim
Sent: Tuesday, September 25, 2012 12:34 PM
To: NFB in Computer Science Mailing List
Subject: [nfbcs] odd jows behavior in command window

Can anyone confirm the odd behavior I've been noticing with jaws 13 and the
Windows 7 command window? On my system, jaws is way too verbose in the
Windows 7 command window. I'd appreciate it if someone would try to
reproduce my problem. To do that, please open a command window and just
start typing. On my system, jaws often reads the entire line including the
prompt.  So if my prompt is "C:\Users\jheim>", if I type in a dir command,
jaws will say "C colon backslash users backslash jheim greater than dir". 


_______________________________________________
nfbcs mailing list
nfbcs at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for nfbcs:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/ntorcolini%40wavecable.co
m


_______________________________________________
nfbcs mailing list
nfbcs at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for nfbcs:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/jheim%40math.wisc.edu

_______________________________________________
nfbcs mailing list
nfbcs at nfbnet.org
http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
To unsubscribe, change your list options or get your account info for nfbcs:
http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/dgl%40dlee.org

-- 
Doug Lee                 dgl at dlee.org                http://www.dlee.org
SSB BART Group           doug.lee at ssbbartgroup.com   http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done, it was
done." --Helen Keller




More information about the NFBCS mailing list