Looking at it a bit more, this is possible. The way I would match events
*except* others would be multiple keyboard instances and the
Keyboard.stop(event) method.

Create one keyboard instance that has your key assignments and another one
that manages it that has a default handler. Your first one has
Keyboard.stop(event) commands. Like so:

var defaultK = new Keyboard().addEvent('keyup', function(event) {
...whatever is the default ... });
var definedK = new Keyboard.addEvent('ctrl+s', function(event) {
myapp.save(); Keyboard.stop(event); });

defaultK.manages(definedK);

I think that should do it.

On Mon, Sep 13, 2010 at 8:58 AM, Andrea Dessì <[email protected]> wrote:

> On Mon, Sep 13, 2010 at 17:50, Aaron Newton <[email protected]> wrote:
>
>> At the moment, I don't think there's a way to match every key *except*
>> some others.
>
>
>
> Thank you Aaron.
>
> At the moment I'm using the Keyboard Class for
> triggering a set of keys and adding a standard event
> keyup/down to the element for triggering everything :P
>
> Would be great to match keys in the Keyboard Class
> using also other special words...
> Example:
> "keyup:!!k": fn,  //will trigger everything but k
>
> Or something like that :D
>
> and of course the default events for keyup/down/press ;)
>
> --
> Andrea
>
>
>
>

Reply via email to