From what I have been reading about the Keyboard class is that only one keyboard class instance can be active in a window at a time. So if that is the case then you
would not be able to have each button have it's own instance of a Keyboard class unless it was to be activated on focus and deactivated on blur.
The only other thing I can think of would be to have a master event handler class that you could pass in an array of objects that would then assign the events functions, so something like the following, this is just something I thought about and sure it is even a good idea yet or not, but you could do something like:
var appEvents = new Array(
{
key: 'ctrl+c'
ids: ['button_copy_id', 'context_copy_id', 'menu_copy_id']
func: doCopy
},
{
key: 'ctrl+x'
ids: ['button_cut_id', 'context_cut_id', 'menu_cut_id']
func: doCut
},
{
key: 'ctrl+v'
ids: ['button_paste_id', 'context_paste_id', 'menu_paste_id']
func: doPaste
}
);
Then the class would assign the keydown events to a master keyboard instance using key as the key and func as the function to call and also add onclick handlers to the element specified in ids.
Any of that make sense? or even worth while building to see if it would be useful functionality?
Actually, come to think of it, Conrad implemented keyboard support in dialogs using the Keyboard class so you might want to have a look at that. We may also want to think about a generalized keyboard utility class or methods (perhaps in Jx.Widget) that could provide an easy way to implement keyboard support for any widget that needs it.
Jon.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.