openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
749 stars 359 forks source link

Create event functions for precise input handling. #1802

Open EliteMasterEric opened 3 weeks ago

EliteMasterEric commented 3 weeks ago

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: