Robot/robot-js

Cannot set autoDelay

Closed this issue · 2 comments

Hey, trying to use robot-js in an Electron app with Angular. I've linked the service below and the problem is that i can't seem to set the autoDelay. Everything else works, i can use this.keyboard().click() without problem but i can't seem to set autoDelay, i've tried with everything i can think of now, examples below.

https://github.com/viktorgullmark/exile-party/blob/features/robot-js/ExilePartyClient/src/app/shared/providers/robot.service.ts

const range = this.electronService.robot.Range(5, 10);
this.keyboard().autoDelay.min = 10;
this.keyboard().autoDelay.max = 30;
this.keyboard().autoDelay = range;

Hey there, it looks like you're instantiating the keyboard class each time. Try the following:

let keyboard = robot.Keyboard();
keyboard.autoDelay.min = 10;
keyboard.autoDelay.max = 30;
keyboard.click (...);

Hey, thanks for the response. Feeling dumb now ofc that's the problem! Thanks!