0

https://github.com/octalmage/robotjs/issues/472

The annoying this with this issue is that it is working for my colleague on their machine, but it isn't working for me and we're at a loss for how to debug.

Expected Behavior

The expectation is that when the user hits the shortcut, which is successfully registered, that the string will appear on the screen in whatever active window the user has open

app.on('ready', () => {
  setTrayItem();

  const ret = globalShortcut.register('Alt+Z', () => {
    robot.typeString("Hello World");
  });

  if (!ret) {
    console.log('registration failed');
  }

});

Current Behavior

Nothing happens!

Your Environment

RobotJS version: "robotjs": "^0.5.1"
Electron: "electron": "^4.0.0",
Chromium 69.0.3497.106,
Node 10.11.0,
V8 6.9.427.24
npm version: 6.4.1
Operating System: macOS 10.14.2
islalobo
  • 617
  • 2
  • 8
  • 22
  • Can you try to put the `robot.typeString` into a function delayed by setTimeout like [here](https://stackoverflow.com/questions/55464204/electron-paste-value-from-clipboard/55505589#55505589)? – snwflk Apr 09 '19 at 20:15
  • It is robotJS working out of the shortcut use case? – Leonardo Buscemi Apr 10 '19 at 20:46
  • No, we've tried stripping the functionality way back and it doesn't work when I run it. Is there a way to debug typeString()? – islalobo Apr 10 '19 at 22:00

0 Answers0