dmauro/Keypress

Suggestion: allow to register listener on multiple elements at the same time

mallocator opened this issue · 1 comments

Extend the API to support arrays when setting up keylisteners:

Old style:

new window.keypress.Listener(document.getElementByID('editor'));
// or with JQuery
new window.keypress.Listener($('#editor)[0]);

New Style (doesn't really change):

new window.keypress.Listener(document.getElementByClass('editable'));

This would even make JQuery integration more idiot proof (which I could have used ;-) ):

new window.keypress.Listener($('#editor));