@cerebral/shortcuts

Install

NPM

npm install @cerebral/shortcuts

Description

This is a tiny module that allows you to bind keyboard shortcuts to Cerebral signals.

It’s created using a very nice library called “shortway” by Thiago Santos

Instantiate


import shortcuts from '@cerebral/shortcuts';

const controller = Controller({
  signals: {
    testSignal: () => console.log("shortcut pressed!")
  },
  modules: {
    shortcuts: shortcuts({
      "ctrl+s": "testSignal"
    })
  }
});