SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Add event timestamps for controller events

Open slouken opened this issue 3 years ago • 1 comments

We now have the ability to pass on event timestamps from the OS, added in https://github.com/libsdl-org/SDL/commit/0a3262e819edc695a764702e8127bbd1b09944ef.

Some controllers have a timestamp in their report, which is currently used for the sensor timestamp. Let's remove the sensor timestamp and fill in the timestamp of the events with that information.

slouken avatar Dec 02 '22 20:12 slouken

From https://github.com/libsdl-org/SDL/issues/1000#issuecomment-1335836230: Nice! For some of the (non-SDL) games I've worked on we've heavily used timestamps from gamepad thumbstick events for high precision and accuracy with some analog aiming controls. Now that this is implemented for some systems I think hooking it up for joysticks would be worthwhile in the future, if it hasn't already been considered.

For example Microsoft's GameInput API has a timestamp feature.

slouken avatar Dec 02 '22 21:12 slouken

so close

I made this change and then backed it out, because when you're integrating sensor timestamps over time you need the precision of the hardware clock in the sensor, rather than introducing error when we try to synchronize with the system clock.

1bsyl avatar Jan 23 '23 15:01 1bsyl