Skip to content

use pydirectinput to send keystrokes rather than win32api’s keybd_event#22

Open
Siphonay wants to merge 1 commit intohzoo:masterfrom
Siphonay:master
Open

use pydirectinput to send keystrokes rather than win32api’s keybd_event#22
Siphonay wants to merge 1 commit intohzoo:masterfrom
Siphonay:master

Conversation

@Siphonay
Copy link

Hello! I’m proposing this change because I was trying to use this with the BizHawk emulators but the keystrokes were getting ignored.

Turns out BizHawk reads key inputs at a driver level, and virtual keyboard events such as the ones sent by keybd_event from win32api will not work. This is the case for many games and programs. So I replaced this with pydirectinput which sends keystrokes at a driver level.

Previous configurations with ordinal addresses would still work, but the library already has all addresses mapped, so they have more convenient shorthands (eg. just 'a' instead of 0x41 or ord("A"))

The drawback to this is that the user has to install a third-party python library, but I think it’s worth it given that it gives TwitchPlaysX compatibility with virtually any game or program.

This should fix #15 and similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commands not going through

1 participant