I quite like the sound of the keydown[enter] style events. I wonder thought does it have much use outside of key events? I suppose mousedown/up could specify the button that was clicked? The reason I ask is perhaps rather than potentially changing the syntax of the event binding calls you could just create a function like $.fn.key("keycode/regex/complex selector") (or somtehing similar) that would be an event specific to the matching keypress/down/up whatever? Just a thought.
James
________________________________
From:
jquery-dev@googlegroups.com on behalf of ajpiano
Sent: Fri 30/01/2009 09:59
To: jQuery Development
Subject: [jquery-dev] Re: Proposal: Attributed events
maybe a few jquery event shortuts to specific keycodes/ranges of
keycodes, which would provide a meaningful semantic layer, as opposed
to further entrenching the spread of ranges of valid numeric keycodes
into our jquery events
$(...).bind("keydown[enter] keydown[numeric]",fn)
or maybe even simply
$(...).bind("enter",fn);
I'm sure there are better ideas out there for implementation than that
but I think something along these lines might be more useful. Unless
you are proposing a generic method of binding to events after
performing a filter based on a property of the event object, in which
case I still sort of think special keypress helpers might be useful.