This feature adds several functions which allow for precise tracking of inputs using timestamps provided by SDL.
SDL provides a timestamp field on each Keyboard key press, and each Gamepad button press and axis change. By recording these timestamps and including them in the event objects, developers can receive a precise record of when the input was pressed.
Using this information requires knowing the current SDL timestamp, thus a lime_sdl_get_ticks() function is provided.
Notes:
This feature was developed for, and is actively used by, Friday Night Funkin' in order to precisely track and rate user inputs.
This code has been tested and proven, however that was in our develop branch and porting the changes over to 8.2.0-Dev may cause some issues.
This creates 5 new events, rather than modifying the existing ones, because adding a new argument is a hard breaking change that prevents applications which use the existing events from building.
Timestamps currently use millisecond timings. SDL version 3, which is currently nearing a stable release, provides support for nanosecond timestamps, which should be used as soon as convenient.
This feature adds several functions which allow for precise tracking of inputs using timestamps provided by SDL.
SDL provides a
timestamp
field on each Keyboard key press, and each Gamepad button press and axis change. By recording these timestamps and including them in the event objects, developers can receive a precise record of when the input was pressed.Using this information requires knowing the current SDL timestamp, thus a
lime_sdl_get_ticks()
function is provided.Notes:
develop
branch and porting the changes over to8.2.0-Dev
may cause some issues.