Skip to content

typeString (and other keyboard functions) ignore setKeyboardDelay and type slowly #717

Open
@slonkazoid

Description

@slonkazoid

Expected Behavior

typeString should type at the correct speed

Current Behavior

typeString types at a very slow, inconsistent speed

Possible Solution

Using XFlush instead of XSync at https://github.com/octalmage/robotjs/blob/master/src/keypress.c#L25

Steps to Reproduce (for bugs)

robot.setKeyboardDelay(5);
console.time("type");
robot.typeString("This is a test");
console.timeEnd("type");
type: 2.776s

Context

I was just testing it and this happened

Your Environment

  • RobotJS version: 0.6.0
  • Node.js version: v16.16.0
  • npm version: 8.11.0
  • Operating System: Kubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions