[Xerte] How do I set up a keypress interaction in Xerte?

Tenney Julian Julian.Tenney at nottingham.ac.uk
Wed Jul 23 09:00:46 BST 2008


If you tab to the button, you can then press 'space' to activate it.
This is accessibility good practice, in line with the guidelines for
allowing keyboard or mouse control.
 
To do as you describe, use rootIcon as the broadcasting icon, then you
code below works. I think the problem was registering and de-registering
key listeners for individual icons. You only really need one icon to
notify you of onKeyDown, and rootIcon made the most sense, so I hooked
it up to that,
 
J

________________________________

From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Swanson
Sent: 22 July 2008 23:13
To: Xerte discussion list
Subject: [Xerte] How do I set up a keypress interaction in Xerte?



I'm trying to set up a keypress interaction, so a user can press Enter
or Tab instead of clicking a button. 

I have an Interaction icon with a Button response working fine, and to
that same interaction I added an Event response. For the eventName I
used onKeyDown(), for the icon property I used the id of the Interaction
icon. To the Event response icon I added a script icon with the
following:

keyPressed = Key.getCode(); 

if ((keyPressed == 13) || (keyPressed == 9)) { // Enter or Tab pressed 
    rootIcon.nextPage(); 
} 

Of course, nothing happens when I press Enter or Tab. What would be the
correct way to do this? 

_____________________________ 

 Paul Swanson 
 Instructional Designer 
 Harland Financial Solutions 
_____________________________ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20080723/32efe2bd/attachment.html


More information about the Xerte mailing list