dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
293 stars 24 forks source link

Keyboard events not always recognized #737

Closed jokker87 closed 1 year ago

jokker87 commented 1 year ago

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)

mithrendal commented 1 year ago

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)

mithrendal commented 1 year ago

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

jokker87 commented 1 year ago

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.

mithrendal commented 1 year ago

this bug was a great catch ... thanks for reporting it 👍

just pushed ui version 2022_09_29 which should fix the issue

lookout for the upgrade dialog in the bottom right edge as seen in the following picture it will show up when cold-starting vAmigaWeb

image

jokker87 commented 1 year ago

No worries, glad you responded that quickly and fixed it right away. Works like a charm now ;)

jokker87 commented 1 year ago

Issue closed and donation done ;)

mithrendal commented 1 year ago

Good to hear that it works for you now. We are very happy about your generous donation. thank you very much for it ! 😃