Gmane
From: David <david <at> jool.nl>
Subject: Re: context key manager
Newsgroups: gmane.comp.web.dojo.user
Date: 2006-07-10 06:59:31 GMT (2 years, 7 weeks, 1 day, 5 hours and 1 minute ago)
Nice to see that there has been some development in this direction.

Here is how I implemented it in another toolkit. The focusmanager was a 
simple ordered list of components that would recieve key events. Every 
time a component was selected with the mouse, it would go on top of the 
list and when it was closed (like a menu or panel), it would be removed 
from the list. When to focusmanager recieves a key event, it would fire 
the onKeyPressed(e) method of the first component in the list, check 
afterwards if the component allowed the event to bubble through, and if 
so, give the event to the next component on the list, etc. etc.

Problems:
* IFrames. The focusmanager only listens on the main document / window

API:

//Puts the component on top of the list to recieve key events
FocusManager.setFocusComponent(component)
//Removes the component from the list, will not recieve any events
FocusManager.removeFocusComponent(component)
//Array of components
FocusManager.components

//The interface for the components which register as focus component
//Notify the component that is has gained / losed focus, is not
//called when the component itself requests the focus with a
// setFocusComponent call)
FocusInterface.setFocus(boolean)

Any other thoughts are appreciated!

Regards,

David

LiuCougar wrote:
> there is a draft proposal here:
> http://dojo.jot.com/GlobalHotkeyAndFocusManager
> Feedback/suggestions are welcomed.
> 
> and have a look at the new Menu2 which supports key navigation
> 
> On 7/7/06, David <david <at> jool.nl> wrote:
>> Hi all,
>>
>> I was wondering if there where any thoughts on something like a context
>> key manager, which would handle key events in context of the current
>> focus. Take for example an explorer like interface (tree + list) with
>> some context menu functionality. How to handle for example a arrow-down
>> key depends on which widget (the tree, list or a context menu) has the
>> current focus.
>>
>> The current tree, table and menu widgets lack keyboard support, but I
>> saw it was on the todo list. Some keyboard support was also topic of
>> discussion last year
>> (http://dojotoolkit.org/pipermail/dojo-interest/2005-October/001511.html), 

_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest <at> dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest