The GW-Scripting list is a discussion list for information regarding the development and use of Window-Eyes scripts. Any subscriber of the GW-Scripting list has the ability to post on-topic messages.

From:

 Kevin Huber

Subject:

 Re: an error crept into one of my scripts

Date:

 Mon, Jun 20, 2011 9:22:23 am
Hi Chip:
I think you might have something there. What the code is supposed to
do is to define the second action of all the cursor keys, but it
undefines both actions of the cursor keys, so if one were to save the
settings after they pressed alt-windows-t, they would be in big
trouble because none of the cursor keys would work.
What I did is that after I pressed alt-windows-t, I tried the cursor
keys, and if they didn't work, I just restarted Window-eyes.
I also found that in most cases, the cursor key actions were only
defined globally. Kevin Huber

On 6/18/11, Chip Orange wrote:
The scope is definitely different for the activeSettings object in 7.5.
it's meaning has changed from what it was in earlier versions. I don't know
if this is effecting your code or not, I don't know your code well enough,
but it's current meaning is only the local scope keys and settings. If one
of those keys you're changing is scoped in the set file to be global, then
I'd guess what you're doing would have no effect at all.

the hotKeys and cursorKeys object members now have a scope property, so you
could at least test on it and see where something you are changing via
activeSettings may not really be having any effect.

What would happen if the user saved their settings after you had modified it
like this? would those changes be saved as a permanent part of their set
file? It looks like it would to me, and this may not be an expected
consequence of using your app?

Chip


-----Original Message-----
From: Kevin Huber [mailto:kevin.huber1@gmail.com]
Sent: Saturday, June 18, 2011 11:05 AM
To: gw-scripting@gwmicro.com
Subject: Re: an error crept into one of my scripts

Hi Chip:
Actually, I commented the "else" section of the code when I was trying to
debug it, and when I sent you the code, I forgot to put it back to its
original form. I appologize for that oversight.
Anyway, if you run that script in its original form with WE 7.5, and press
alt-windows-t to turn on "PointerFollowCursor" mode, you will fint that both
of the options of all the cursoring keys become undefined, so that piece of
code is causing the problem. I wonder if it has something to do with the
scope.
Kevin Huber



On 6/17/11, Chip Orange wrote:
I think Bruce has nailed it Kevin; with the "else" commented out, the
line which would have added the mouse following the cursor is being
executed only when the "if" is true, which is only for version 7.0.

does this guess fit with what you observe?

Chip


-----Original Message-----
From: Kevin Huber [mailto:kevin.huber1@gmail.com]
Sent: Friday, June 17, 2011 3:47 PM
To: gw-scripting
Subject: an error crept into one of my scripts

Hi:
I noticed that there is an error in my "MakePointerFollowCursor"
script" which didn't exist in previous versions of Window-eyes before
7.5.
The error is in the following code:
dim ck 'cursor keys object
set ck = ActiveSettings.CursorKeys
if ToggleFlag= 0 then
'make the mouse pointer follow the cursor ToggleFlag = 1 speak
mystrings("PointerFollowCursor") for i = 1 to ck.count
ck(i).secondaction.id = CKAExecuteHotkey If InStr(CStr(Version),
"7.0") = 1 Then ck(i).SecondAction.Parameter = HKMouseToFocus-1 'else
ck(i).SecondAction.Parameter = HKMouseToFocus end if next else 'do not
make the mouse pointer follow the cursor ToggleFlag=0 speak
mystrings("PointerNotFollowCursor")
for i = 1 to ck.count
ck(i).SecondAction.ID = CKAUndefined
next
end if

I have narrowed the problem down to the following lines:
for i = 1 to ck.count
ck(i).secondaction.id = CKAExecuteHotkey If InStr(CStr(Version),
"7.0") = 1 Then ck(i).SecondAction.Parameter = HKMouseToFocus-1 'else
ck(i).SecondAction.Parameter = HKMouseToFocus end if next

I was able to test it with a previous version of Window-eyes and it
worked fine.
What is the problem and how can I change my code to get around it?
Kevin Huber