Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.sendToReceivers(data);
break;
case 'sr':
screenshare.ffmpeg.stop(
() => screenshare.ffmpeg.start('screenshare', coords.scale)
);
break;
case 'wr':
console.log('wr!');
screenshare.ffmpeg.stop(
() => screenshare.ffmpeg.start('webcam', coords.scale)
);
break;
case 'rt':
console.log('type', coords.text);
robot.typeString(coords.text);
// keyToggle
break;
case 'kt':
try {
robot.keyTap(coords.key);
} catch (e) {
console.log(coords.key, 'is not supported', e);
}
break;
default:
// We just dump stuff for logging
console.log(cmd);
break;
}
}
setTimeout(function(){
robot.typeString(fakeClipboard);
fakeClipboard = '';
}, 500);
});
typeString(string) {
if (!this.settingsHandler.enableRealtimeStrokes || !string) {
return;
}
if (this.settingsHandler.typeMethod == 'keyboard') {
robotjs.typeString(string);
} else {
var ctrlKey = process.platform === "darwin" ? "command" : "control";
clipboard.writeText(string);
robotjs.keyTap("v", ctrlKey);
}
}
typeString(string) {
if (!this.settingsHandler.enableRealtimeStrokes || !string) {
return;
}
if (this.settingsHandler.typeMethod == 'keyboard') {
robotjs.typeString(string);
} else {
var ctrlKey = process.platform === "darwin" ? "command" : "control";
clipboard.writeText(string);
robotjs.keyTap("v", ctrlKey);
}
}
setTimeout(() => {
robot.typeString(hostname);
robot.keyTap("enter");
},100)
},100);
settings.typedString.forEach((stringComponent) => {
if (stringComponent.type == 'barcode') {
robot.typeString(message.scan.text);
} else if (stringComponent.type == 'text') {
robot.typeString(stringComponent.value);
} else if (stringComponent.type == 'key') {
robot.keyTap(stringComponent.value);
} else if (stringComponent.type == 'variable') {
robot.typeString(eval(stringComponent.value));
}
});
}