Adventurecraft-Awakening / AC-Legacy-Mod

The Legend of AC, a story of Legacy.
MIT License
6 stars 5 forks source link

[Issue / Enhancement] Keyboard Event behaves different based on key pressed #84

Open Gordon-Neb opened 6 months ago

Gordon-Neb commented 6 months ago

So pressing a key once and printing the keyID will result in the key ID (which is good) and then defaults to -1 if it is printed in "on Update" for example. Here an enhancement would be to track if the key is still down so it stays that id and only on release gets set to -1. Also when holding any of those keys it will repeatedly trigger the key event so that would make sense to have that state.

However the main issue is that it does not behave like that for all keys. Every key except the number and alphabet keys will result in just 1 key press event. It also doesnt default to -1.

Sidenote: There is a method for the keyboard Object keyboard.isKeyDown() which also gets an index out of bounce error when the default to id -1 happens..