Skip to content

DirectInput joystick incorrect initial axis positions #3816

@SDLBugzilla

Description

@SDLBugzilla

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.13
Reported for operating system, platform: Windows 10, x86

Comments on the original bug report:

On 2020-09-03 20:19:51 +0000, Jean-Pierre Gygax wrote:

Created attachment 4457
DInput Poll() call immediately after opening a joystick

When first querying DirectInput joystick axis positions, they are reported as 0, even when their physical position is different.

After some research, it appears Windows requires some time between the call to IDirectInputDevice8_Poll() and the collecting of the resulting data via IDirectInputDevice8_GetDeviceData().

The attached patch is a crude but apparently functional solution to this problem.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions