fix special keys auto-type in linux

This commit is contained in:
antelle 2016-07-14 21:56:48 +03:00
parent 51e97d69c0
commit d0325e48e3
No known key found for this signature in database
GPG Key ID: 26C38FADD3BDF3CA
2 changed files with 14 additions and 4 deletions

View File

@ -37,11 +37,13 @@ AutoTypeEmitter.prototype.setMod = function(mod, enabled) {
};
AutoTypeEmitter.prototype.text = function(text) {
Object.keys(this.mod).forEach(function (mod) {
this.pendingScript.push('keydown ' + ModMap[mod]);
});
this.pendingScript.push('type ' + text);
var that = this;
Object.keys(this.mod).forEach(function (mod) {
that.pendingScript.push('keydown ' + ModMap[mod]);
});
that.pendingScript.push('type ' + text.split('').map(function(char) {
return char === '\'' ? '"\'"' : '\'' + char + '\'';
}).join(''));
this.waitComplete(function(err) {
if (err) { return that.callback(err); }
Object.keys(that.mod).forEach(function (mod) {
@ -70,6 +72,11 @@ AutoTypeEmitter.prototype.copyPaste = function(text) {
this.waitComplete();
};
AutoTypeEmitter.prototype.wait = function(time) {
this.pendingScript.push('sleep ' + (time / 1000));
this.callback();
};
AutoTypeEmitter.prototype.waitComplete = function(callback) {
if (this.pendingScript.length) {
var script = this.pendingScript.join(' ');

View File

@ -1,6 +1,9 @@
Release notes
-------------
##### v1.2.2 (2016-07-14)
`-` fix special keys auto-type in linux
##### v1.2.1 (2016-07-12)
`-` fix storage auth popups on desktop