KeyBind

KeyBind provides an interface to the global keymap.

Example

import { KeyBind } from 'dripcap';

KeyBind.bind('command+q', '!menu', 'core:quit');

Class Methods

KeyBind.bind(command,selector,action)

  • command String
  • selector String
  • action Function | String

The action will be called when the command is triggered. If the action is String, PubSub.pub(action) will be executed instead.

You should always use command instead of ctrl. command will be automatically replaced with ctrl on Linux and Windows.

KeyBind.unbind(command,selector,action)

  • command String
  • selector String
  • action Function | String

Removes the action associated with given command and selector.

KeyBind.get(selector,action)

  • selector String
  • action Function | String
  • Returns: String

Returns the command string associated with given selector and action or null if there is no such command.

results matching ""

    No results matching ""