Is it possible to simulate keyboard/mouse event in NodeJS?

后端 未结 5 1923
别跟我提以往
别跟我提以往 2020-12-06 10:07

Imagine that a NodeJS module, when invoked from console, outputs some introductory messages and then waits for user input (click enter or esc). This module already has and d

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 11:05

    Responding to @Venryx. They are right that robotjs is going to have a delay, especially if you have to load node first, however, if you already have node loader, it may be worth trying out

    robot.setKeyboardDelay(0)
    

    The default setting for a delay is 10ms. This helped me tremendously.

提交回复
热议问题