Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Latest commit

 

History

History
40 lines (27 loc) · 662 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 662 Bytes

Keyboadr Shortcuts Module

Add keyboard shortcuts to your application

Installation

npm install --save @wildebeest/keyboard-shortcuts

Requirements

It's usefull to know these libraries:

  • inversify
  • @wildebeest/js-modules

Usage

Create Application

let app: Application();
app.run([KeyboardShortcutsModule]);

Name your shortcut

let keyboardShortcutsService = app.getContainer().get(KeyboardShortcutsService);
keyboardShortcutsService.nameShortcuts("open file", "ctrl+o");

Listen for a shortcut to be pressed

keyboardShortcutsService.on("open file", (event: any) => {
    // do something
});