Hi, is there any way in the GameLab to get the exact millisecond a key was pressed on the keyboard? Currently the best solution we have is to do
if (keyWentDown("A")) { getTime(); }
…However, this will return a seemingly random millisecond within the 16 millisecond window for a frame (assuming 60 frames per second), which is practically no better than just using World.frameCount
. We know the AppLab has event listeners which I imagine are more precise. Is there anything similar in the GameLab?
Here is the test program we made to show this (there are no visuals, it’s all in the console): https://studio.code.org/projects/gamelab/eZMhfXlwL_Q2k6PqaVwcybwvfJ_2PufDAsoyOYBE4Lg