But enter and space still fires the click event. By attaching a click
listener it will work just fine for you.
Click is not a mouse event as most of the people think.

--
Fábio Miranda Costa
Solucione Sistemas
Engenheiro de interfaces


On Mon, Nov 30, 2009 at 10:05 AM, אריה גלזר <[email protected]> wrote:

> obviously  i ment condition instead of confirm
>
> -----------
> אריה גלזר
> 052-5348-561
> 5561
>
>
> On Mon, Nov 30, 2009 at 14:03, אריה גלזר <[email protected]> wrote:
>
>> ok, so i was making a widget, and i wanted its buttons to simulate the
>> behavior of links. when i press a link with either space, enter or click it
>> activates. with the keyboard, only enter works (at least in my FF 3.5.5).
>> so i wanted to create something like this:
>> Element.Events.activated = {
>>         base : ['keydown','click'],
>>         confirm : function(e){
>>             return (
>>                 e.type === 'click',
>>                 e.key === 'enter',
>>                 e.key === 'space'
>>             );
>>         }
>>     }
>>
>> the only problem is that an event can only have one base. so i was
>> wondering if there was a way of doing this without a rewrite to the core
>> -----------
>> אריה גלזר
>> 052-5348-561
>> 5561
>>
>
>

Reply via email to