[Kss-devel] Key events - change proposal
Pawel Lewicki
lewicki at provider.pl
Fri Feb 2 16:09:40 CET 2007
Hi,
I have a proposal of changing key events, especially keyup event. Now
they require code of pressed key in keyCodes parameter to trigger an
event. In my usecase I don't care which key is pressed as I pass input
value as a parameter not key code itself. I guess it is quite a common
use-case as 'change' event is triggered when focus is lost.
So my proposal is to trigger that event even when no keyCodes provided.
I use another branch but on trunk it would be :
http://codespeak.net/svn/kukit/kukit.js/trunk/kukit/plugin.js
===================================================================
--- plugin.js (revision 37810)
+++ plugin.js (working copy)
@@ -144,7 +144,7 @@
}
var func = function(e) {
target = kukit.pl.getTargetForBrowserEvent(e);
- if (allowbubbling || target == node) {
+ if (allowbubbling || target == node || oper.parms.keyCodes=="") {
var keyCode = e.keyCode.toString();
if (! oper.parms.keycodes || keycodes[keyCode]) {
// Execute the action, provide browserevent on oper
Maybe additional parameter for 'keyCodes-required' would be added.
Pawel Lewicki
More information about the Kss-devel
mailing list