1.0.1 • Published 9 years ago

engine-keypress v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

engine-keypress

Tiny keypress module for Engine.

Configuration

The shortcuts array contains objects in the following format:

  • k (Number): The key code.
  • c (String): A special key that should be pressed as well.
  • f (String): A global or module function name (e.g. emit).
  • args (Array): The function arguments.
{
    "shortcuts": [
        {
            "k": 66,
            "c": "ctrl",
            "f": "someMethod",
            "args": [
                "arg1",
                "arg2"
            ]
        }
    ]
}

Events

This module doesn't emit any events, unless they are configured in the shortcuts array (using the emit function, like in the example).

The module does not listen to any events.

How to contribute

Have an idea? Found a bug? See how to contribute.

License

See the LICENSE file.