mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-21 18:02:35 +01:00
Swap keyboard.js with Mousetrap
mousetrap will not trigger when in input fields
This commit is contained in:
parent
3cc6fbecc9
commit
24e1aa5bcd
10
package-lock.json
generated
10
package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user