<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2>You can set up a key press interaction by adding an event
response to the interaction icon that contains your button. The eventName
property is onKeyDown and set the icon property to rootIcon. Then add a
script icon with something like the following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2>keyPressed = Key.getCode();</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2>if ((keyPressed == 13) || (keyPressed == 9)) { // Enter or
Tab pressed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2><BR> // do whatever</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN><SPAN class=554375315-24102008><FONT
face=Verdana color=#0000ff size=2><BR>}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=554375315-24102008><FONT face=Verdana
color=#0000ff size=2>The key numbers correlate to the ASCII chart of characters.
A-Z is 65-90, a-z is 97-122, so for a lower-case y you would want to look for
121, capital Y should be 89. Lower-case n should be 110, and capital N should be
78 (if I counted correctly).</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Elly
Langewis<BR><B>Sent:</B> Friday, October 24, 2008 8:48 AM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> Re: [Xerte] default
button<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Thanks Julian, that explains. </DIV>
<DIV>Is it possible to set the focus to a certain button? And is it possible
to make a button react to a certain key pressed, like when I have two buttons,
yes and no, and want the user to be able to press Y or N (besides making
a third response to catch that)?</DIV>
<DIV> </DIV>
<DIV>Elly<BR><BR></DIV>
<DIV class=gmail_quote>On Fri, Oct 24, 2008 at 5:03 PM, Julian Tenney <SPAN
dir=ltr><<A
href="mailto:Julian.Tenney@nottingham.ac.uk">Julian.Tenney@nottingham.ac.uk</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV lang=EN-GB link="blue" vlink="purple">
<DIV>
<P><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d">It's built in
accessibility. It will only respond to keys whilst it has the focus. When
you click elsewhere, the focus moves away from the button and it doesn't
respond to keypresses. All the interaction responses can be controlled with
the keyboard.</SPAN></P>
<P><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d"></SPAN> </P>
<DIV
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P style="MARGIN-LEFT: 36pt"><B><SPAN lang=EN-US
style="FONT-SIZE: 10pt">From:</SPAN></B><SPAN lang=EN-US
style="FONT-SIZE: 10pt"> <A
href="mailto:xerte-bounces@lists.nottingham.ac.uk"
target=_blank>xerte-bounces@lists.nottingham.ac.uk</A> [mailto:<A
href="mailto:xerte-bounces@lists.nottingham.ac.uk"
target=_blank>xerte-bounces@lists.nottingham.ac.uk</A>] <B>On Behalf Of
</B>Elly Langewis<BR><B>Sent:</B> Friday, October 24, 2008 3:41
PM<BR><B>To:</B> Xerte discussion list<BR><B>Subject:</B> [Xerte] default
button</SPAN></P></DIV>
<DIV>
<DIV></DIV>
<DIV class=Wj3C7c>
<P style="MARGIN-LEFT: 36pt"> </P>
<DIV>
<P style="MARGIN-LEFT: 36pt">Hi,</P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt"> </P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt">I've got a perpetual button ('Menu') in my
Entry Frame. For some reason, when I have used the button (just once), this
button will also get pressed when I hit the space bar. As I have not found
yet how to let a button react to key responses I was quite
surprised...</P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt">Does anyone know what caused this behaviour? It
disappeats after using a text entry response, but after hitting the button
again it reacts to the space bar again.</P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt"> </P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt">TIA</P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt"> </P></DIV>
<DIV>
<P style="MARGIN-LEFT: 36pt">Elly</P></DIV>
<DIV>
<P
style="MARGIN-LEFT: 36pt"> </P></DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>Xerte
mailing list<BR><A
href="mailto:Xerte@lists.nottingham.ac.uk">Xerte@lists.nottingham.ac.uk</A><BR><A
href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte"
target=_blank>http://lists.nottingham.ac.uk/mailman/listinfo/xerte</A><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Elly Langewis<BR>courseware developer<BR>Department of
Biology<BR>Utrecht University<BR></BLOCKQUOTE></BODY></HTML>