add mousetrap, enable copy/paste in shell
This commit is contained in:
parent
30c6dcae6f
commit
3c354a2267
3 changed files with 31 additions and 3 deletions
28
js/shell.js
28
js/shell.js
|
|
@ -35,8 +35,34 @@
|
|||
|
||||
function initCopayShellBindings() {
|
||||
|
||||
var ipc = require('ipc');
|
||||
var ipc = require('ipc');
|
||||
var clipb = require('clipboard');
|
||||
|
||||
// atom shell forces to implement the clipboard on our own - thanks obama.
|
||||
|
||||
Mousetrap.stopCallback = function() { return false };
|
||||
|
||||
Mousetrap.bind('ctrl+c', function(e) {
|
||||
clipb.writeText(window.getSelection().toString());
|
||||
});
|
||||
|
||||
Mousetrap.bind('ctrl+v', function(e) {
|
||||
if (document.activeElement) {
|
||||
document.activeElement.value = clipb.readText();
|
||||
}
|
||||
});
|
||||
|
||||
Mousetrap.bind('command+c', function(e) {
|
||||
clipb.writeText(window.getSelection().toString());
|
||||
});
|
||||
|
||||
Mousetrap.bind('command+v', function(e) {
|
||||
if (document.activeElement) {
|
||||
document.activeElement.value = clipb.readText();
|
||||
}
|
||||
});
|
||||
|
||||
// handle messages
|
||||
ipc.on('address:create', function(data) {
|
||||
location.href = '#/addresses';
|
||||
var ctrl = controller('AddressesController');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue