openfl / lime

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

Implemented precise key events #1688

Closed EliteMasterEric closed 2 months ago

EliteMasterEric commented 1 year ago

This feature PR adds two new key press event, one for pressing a key and one for releasing a key. The distinction is that the precise key press events include the SDL timestamp of the keypress. By calling SDL_GetTicks() (which this PR also includes an interface for), you can calculate the number of milliseconds since the key was pressed. This is useful for mitigating input latency.

Notes:

EliteMasterEric commented 7 months ago

Since I made this PR I also had to tweak these code changes to make a similar addition to gamepads.

That commit is public.

EliteMasterEric commented 2 months ago

Redone in #1802 to include the gamepad stuff and exclude extra commits.