[jawsscripts] Re: Does any event trigger when you use the quick nav keys?

  • From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 9 Mar 2008 10:13:44 -0700

I'm not sure if this behavior is a bug in my version of JAWS9, or is standard behavior with IE7, but I cannot get KeyPressedEvent to fire.


The scripts need to be set up as an external script set, so I'm adding them to the default IE7 scripts using the usual line
use "ScriptPlugin.jsb"

Due to the nature of the scripts, I won't be able to depend on a modification of the default KeyPressedEvent function within the default IE script set. The plugin that I'm making is going to be distributed publically, and will be compatible with several different JAWS versions, including IE6.

I see that there is a KeyPressedEvent function within the default IE7 script file, would this be conflicting with mine?

Also, I've tried the following code blocks, which would solve the problem if they worked...

Script FocusToNextField ()
PerformScript FocusToNextField()
let g_i_isWithinTarget = isTargetObject ()
EndScript
Script FocusToPriorField ()
PerformScript FocusToPriorField()
let g_i_isWithinTarget = isTargetObject ()
EndScript

Both of the above scripts are also within the default IE7 script file, so I'm wondering if there is a conflict.

Strangely though, the following script blocks work fine, even though they too are also within the default IE7 script file as well...

Script SayNextLine ()
PerformScript SayNextLine()
let g_i_isWithinTarget = isTargetObject ()
EndScript
Script SayPriorLine ()
PerformScript SayPriorLine()
let g_i_isWithinTarget = isTargetObject ()
EndScript

So, leading me to conclude, I really have no idea what's going on...


----- Original Message ----- From: "Dennis Brown" <DennisTBrown@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Sunday, March 09, 2008 9:20 AM
Subject: [jawsscripts] Re: Does any event trigger when you use the quick nav keys?


Also use a variable that determines if quick nav keys are activated.
There is a function and a flag for this, so run the function in FocusChangedEvent to set or unset the global flag, then use that flag as your first step in the condition statement in KeyPressedEvent. That makes it less intrusive on regular keypresses. Also check for FormsMode flag in that same condition so it doesn't activate if entering text in a form field.

Thanks,
Dennis Brown
----- Original Message ----- From: <chad.foster@xxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Sunday, March 09, 2008 10:34 AM
Subject: [jawsscripts] Re: Does any event trigger when you use the quick nav keys?


You should insert some logic into KeyPressedEvent to make sure your
logic needs to fire, not just fire your logic every time this event is
fired. So you would want to check for:

(1) Is the nIsScriptKey parameter variable TRUE or FALSE? You only
want to proceed if it is TRUE.
(2) Is the Virtual PC cursor active? You should proceed if it is TRUE.
(3) Is the KeyPressedEvent being fired from a quicknav key? You will
need to write a function to determine if the current script key is a
quicknav key combination. Note: use the length of the
GetCurrentScriptKey function's return value, along with StringSegment
using the plus sign (+) as the delimiter.
(4) If all of these conditions are met, fire your logic, otherwise, return.

Using the order I listed above minimizes overhead, since you are
proceeding in the order of operations that use less memory up-front.


--Chad


On 3/8/08, Bryan Garaventa <bgaraventa11@xxxxxxxxxxxxxx> wrote:
This won't work though, the script checks for a condition by querying
elements on a web page, then when the condition is found, a variable object for the DOM is stored, and a scheduled event runs to check on the condition
of a specific element every two seconds.

If this script were triggered every time a key is pressed, it would be way
too intrusive and would degrade performance.

It does work if I attach the script to the main navigation commands like
prior line, next line, paragraph, etc., but the only condition that gets
past the script handler however, is when the quick nav keys are used to jump
directly into a form element, which doesn't look to trigger any sort of
event like FocusChangeEvent, or FocusPointMovedEvent.

If there isn't a basic event handler for this, then I guess I'll just have
to attach key assignments to e and f to check for the condition, then
continue on to the quick nav command. It's a bit clunky like this though.


----- Original Message -----
From: <chad.foster@xxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Saturday, March 08, 2008 3:53 PM
Subject: [jawsscripts] Re: Does any event trigger when you use the quick nav
keys?


> Bryan, check out KeyPressedEvent.
>
>
> --Chad
>
>
> On 3/8/08, Bryan Garaventa <bgaraventa11@xxxxxxxxxxxxxx> wrote:
>> I'm trying to attach an event that runs when you use the quick nav >> keys
>> such
>> as F or E on a web page. Is there any event that deals with this?
>>
>> Thanks,
>>
>> Bryan
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>
>
> --
> Chad Foster
> Access Technology Solutions
> http://www.GO-ATS.net
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>

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




--
Chad Foster
Access Technology Solutions
http://www.GO-ATS.net
__________
View the list's information and change your settings at
//www.freelists.org/list/jawsscripts



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


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

Other related posts: