[Xerte] default button

Elly Langewis e.a.langewis at gmail.com
Fri Oct 24 17:31:59 BST 2008


Paul,

Yes, but I would like not to have to code the same response to two different
responses (like pressing Yes or the Y-key).
I guess I have to find a way to fire an event from both, that goes to a
third repsonse for both, or find a pressKey function, so I can emulate a
keypress (like pressKey('n') when button No is clicked) and get both
responses in one.

Julian,

That would be very nice! If I could set the focus I could control where you
go to when the spacebar is pressed, so you will not end up repeatedly going
back to the menu before you figure out what is causing that. In our modules
we use the spacebar to go to the next piece of text (when texts appear not
at once but paragraph by paragraph).

Thanks.

Elly



On Fri, Oct 24, 2008 at 6:07 PM, Paul Swanson <Paul.Swanson at harlandfs.com>wrote:

>  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:
>
> keyPressed = Key.getCode();
>
> if ((keyPressed == 13) || (keyPressed == 9)) { // Enter or Tab pressed
>
>   // do whatever
>
> }
>
> 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).
>
>  ------------------------------
>  *From:* xerte-bounces at lists.nottingham.ac.uk [mailto:
> xerte-bounces at lists.nottingham.ac.uk] *On Behalf Of *Elly Langewis
> *Sent:* Friday, October 24, 2008 8:48 AM
> *To:* Xerte discussion list
> *Subject:* Re: [Xerte] default button
>
>   Thanks Julian, that explains.
> 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)?
>
> Elly
>
> On Fri, Oct 24, 2008 at 5:03 PM, Julian Tenney <
> Julian.Tenney at nottingham.ac.uk> wrote:
>
>>  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.
>>
>>
>>
>> *From:* xerte-bounces at lists.nottingham.ac.uk [mailto:
>> xerte-bounces at lists.nottingham.ac.uk] *On Behalf Of *Elly Langewis
>> *Sent:* Friday, October 24, 2008 3:41 PM
>> *To:* Xerte discussion list
>> *Subject:* [Xerte] default button
>>
>>
>>
>> Hi,
>>
>>
>>
>> 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...
>>
>> 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.
>>
>>
>>
>> TIA
>>
>>
>>
>> Elly
>>
>>
>>
>> _______________________________________________
>> Xerte mailing list
>> Xerte at lists.nottingham.ac.uk
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>>
>>
>
>
> --
> Elly Langewis
> courseware developer
> Department of Biology
> Utrecht University
>
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
>


-- 
Elly Langewis
courseware developer
Department of Biology
Utrecht University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20081024/01ccc68b/attachment.html


More information about the Xerte mailing list