How to use the robotjs.typeString function in robotjs

To help you get started, we’ve selected a few robotjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zz85 / contact.js / src / touchpad.js View on Github external
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;
		}
	}
github secretin / secretin-lib / electron / electron.js View on Github external
setTimeout(function(){
        robot.typeString(fakeClipboard);
        fakeClipboard = '';
      }, 500);
    });
github fttx / barcode-to-pc-server / electron / src / handlers / scans.handler.ts View on Github external
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);
        }
    }
github fttx / barcode-to-pc-server / electron / src / handlers / scans.handler.ts View on Github external
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);
        }
    }
github PrismarineJS / node-minecraft-wrap / lib / client_control.js View on Github external
setTimeout(() => {
        robot.typeString(hostname);
        robot.keyTap("enter");
      },100)
    },100);
github fttx / barcode-to-pc-server / electron / main.js View on Github external
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));
                    }
                });
            }