diff --git a/package-lock.json b/package-lock.json index fde24466..623eb41d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4378,11 +4378,6 @@ "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", "dev": true }, - "keyboardjs": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/keyboardjs/-/keyboardjs-2.4.1.tgz", - "integrity": "sha1-fFrShpWiG2xNBmaBwSc3amD5rNE=" - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -4644,6 +4639,11 @@ "resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz", "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==" }, + "mousetrap": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.1.tgz", + "integrity": "sha1-KghfXHUSlMdefoH27CVFspy/Qtk=" + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", diff --git a/package.json b/package.json index c030e296..6cfcca89 100644 --- a/package.json +++ b/package.json @@ -60,10 +60,10 @@ "file-type": "^4.1.0", "github-api": "^3.0.0", "jquery": "^3.1.1", - "keyboardjs": "^2.3.3", "lodash": "^4.16.4", "mime-types": "^2.1.14", "moment": "^2.18.1", + "mousetrap": "^1.6.1", "react": "^15.3.2", "react-dom": "^15.3.2", "react-hammerjs": "^0.5.0", diff --git a/src/renderer.jsx b/src/renderer.jsx index a750e0c3..7aeab987 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -1,6 +1,6 @@ const electron = require('electron'); // eslint-disable-line const $ = require('jquery'); -const keyboardJs = require('keyboardjs'); +const Mousetrap = require('mousetrap'); const _ = require('lodash'); const Hammer = require('react-hammerjs'); const path = require('path'); @@ -145,19 +145,19 @@ class App extends React.Component { load(ev.dataTransfer.files[0].path); }; - keyboardJs.bind('space', () => this.playCommand()); - keyboardJs.bind('k', () => this.playCommand()); - keyboardJs.bind('j', () => this.changePlaybackRate(-1)); - keyboardJs.bind('l', () => this.changePlaybackRate(1)); - keyboardJs.bind('left', () => seekRel(-1)); - keyboardJs.bind('right', () => seekRel(1)); - keyboardJs.bind('period', () => shortStep(1)); - keyboardJs.bind('comma', () => shortStep(-1)); - keyboardJs.bind('c', () => this.capture()); - keyboardJs.bind('e', () => this.cutClick()); - keyboardJs.bind('i', () => this.setCutStart()); - keyboardJs.bind('o', () => this.setCutEnd()); - keyboardJs.bind('h', () => this.toggleHelp()); + Mousetrap.bind('space', () => this.playCommand()); + Mousetrap.bind('k', () => this.playCommand()); + Mousetrap.bind('j', () => this.changePlaybackRate(-1)); + Mousetrap.bind('l', () => this.changePlaybackRate(1)); + Mousetrap.bind('left', () => seekRel(-1)); + Mousetrap.bind('right', () => seekRel(1)); + Mousetrap.bind('.', () => shortStep(1)); + Mousetrap.bind(',', () => shortStep(-1)); + Mousetrap.bind('c', () => this.capture()); + Mousetrap.bind('e', () => this.cutClick()); + Mousetrap.bind('i', () => this.setCutStart()); + Mousetrap.bind('o', () => this.setCutEnd()); + Mousetrap.bind('h', () => this.toggleHelp()); electron.ipcRenderer.send('renderer-ready'); }