Keyboard events not always recognized
jokker87 opened this issue · comments
Looks like the keyboard control sometimes handles right-arrow presses incorrect. Like in rainbow island, if you quickly turn right from running left, the character turns, but pauses for some delay and then starts running right. happens on different browsers, including mobile phone browsers (i.e. Safari on Iphone with BT keyboard)
I did a quick inspection with AmigaTestKit
I saw during the inspection with the current keyboard joystick emulation that it is possible to generate invalid joystick movements ... which probably cause the effect in rainbow island...
e.g.
use case run left and turn to right
left key_down
-> left joystick press
(-- hold key for several seconds, then suddenly you want to turn right --)
right key_down
-> right joystick press
(--now both joystick directions are pressed which is invalid ...--)
left key_up
-> left joystick release
(-- joystick directions are valid again character runs to the right ...--)
...
the issue will be fixed when we implement something to prevent these invalid states
issue is confirmed for
https://vamigaweb.github.io (github repo https://github.com/vAmigaWeb/vAmigaWeb)
and also in
https://vc64web.github.io (github repo https://github.com/vc64web/virtualc64web)
further investigation showed that it is not because of invalid states ... the problem is that the release of the former key direction resets the complete joystick axis ... i.e. in the following sequence left_down
, right_down
, left_up
the last left up clears the x axis ... this is wrong ... it should be ignored
Many thanks for investigating the issue and respoding with feedback that fast, really appreciate it. And btw, very nice and cool project, absolutely love the easy setup, features and simple UI.
No worries, glad you responded that quickly and fixed it right away. Works like a charm now ;)
Issue closed and donation done ;)
Good to hear that it works for you now. We are very happy about your generous donation. thank you very much for it ! 😃