Skip to content

Windows keyboard scan codes #22

Open
@ProbablePrime

Description

@ProbablePrime

I was having a few issues with your module and some applications mostly video games. These applications won't respond to keyboard events triggered from robot.

After tracing this down and examining several other keyboard emulators(robotjs,Java's Robot Classes, My own Handler) I've pinned this down to using virtual key codes over scan codes for windows keyboard events. Which DirectInput/XInput utilizing projects seem to listen to a lot more reliably.

I've edited the keyboard code for robot to use scan codes and then tested it with the problematic applications which now see events from Robot.

Other software designed to interface with keyboard events also tend to use scan codes Examples being FreePIE and AutoHotKey

I was going to open a PR to convert to scan codes but thought some discussion might be better to start as virtual key codes might be useful for some cases. I can't find anything on the internet to suggest this.

From AutoHotKey it looks like we might be able to send both Virtual and scan codes at the same time. I can update things to do that too.

Do you have any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAn error or incorrect implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions