Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual keyboard with autorepeat #161

Closed
Vweber73 opened this issue May 6, 2022 · 20 comments
Closed

Virtual keyboard with autorepeat #161

Vweber73 opened this issue May 6, 2022 · 20 comments

Comments

@Vweber73
Copy link

Vweber73 commented May 6, 2022

Hi,
Could the changes done for vAmigaWeb keyboard could be done as well for vc64web ?

Thanks and cheers

@mithrendal
Copy link
Collaborator

Hi @Vweber73 I have ported the upgraded virtual keyboard from vAmigaWeb ...

what I saw is that the initial basic screen did only auto repeat some keys cursor space and del key... other keys were not repeated despite an emulated long press duration...

you could launch the program "anykey" via the integrated csdb browser... open snapshot and select there as a source "csdb" now you can search for "anykey" this is a keyboard test program ...

image

in any key you could see the real press time...

@Vweber73
Copy link
Author

Hi,

Many thanks ! I have just tested it with the best possible test - Fighter Pilot !
Overall it works quite well. The space key now works to select an item, Q and A for thrust control, U for landing gear, M for map... All correct ! :)
Only strange thing is cursor keys: right and down autorepeat correctly in the basic interpreter (and have the "glow" surrounding them), but not up and left ! Any clue ?

Also:
-vc64web kept both status bars of the phone, unlike vAmiga. I like this mode actually, not bad, as an option would be cool;
-The noise of the reactors of Fighter Pilot are still heard after the app is suspended ! Bug ?

Many thanks and best regards

@Vweber73
Copy link
Author

Also:
-Even in "exact timing" mode, keyboard scrolling can still occur (for instance with long press on the "K" key)
-I saved a snapshot of fighter pilot. When I restored it the sound was gone... Only when I pressed "Q" to increase the thrust, did the sound resume...

@mithrendal
Copy link
Collaborator

Only strange thing is cursor keys: right and down autorepeat correctly in the basic interpreter (and have the "glow" surrounding them), but not up and left ! Any clue ?

fixed 😎 those were special because they do not really exists on a c64 keyboard ... it is always a combination with shift and the opposite direction e.g. shift + ArrowRight for ArrowLeft . I think I fixed it now...

@Vweber73
Copy link
Author

Works well, many thanks ! :)

@mithrendal
Copy link
Collaborator

mithrendal commented May 17, 2022

vc64web kept both status bars of the phone, unlike vAmiga. I like this mode actually, not bad, as an option would be cool;

should we open a separate issue ?

I found this when I searched for how to programmatically change the display setting in a PWA https://stackoverflow.com/questions/53048372/how-to-programmatically-switch-display-from-standalone-to-fullscreen-in-pwa

The noise of the reactors of Fighter Pilot are still heard after the app is suspended ! Bug ?
-I saved a snapshot of fighter pilot. When I restored it the sound was gone... Only when I pressed "Q" to increase the thrust, did the sound resume...

we should address this in a separate issue too... BTW is this reproducable ? or is it more like random ... sometimes sound fails to come back ?

I close this issue ok ? If there is still anything wrong we could reopen it...

@Vweber73
Copy link
Author

Hi,
Not quite close yet, still a small issue,as I said you can still scroll the keyboard by touching a key even in "exact timing" mode, this is not supposed to be the case I guess ?
As for the noise that persists (although it hangs on the same note) when you suspend the app, it is systematic, it happens every time with every game or demo.
As for the sound not coming back, I tried again a new snapshot of fighter pilot while being in the aircraft, and same thing, when I load it, the reactor sound is gone, although it is back as soon as I press Q or A to modify the thrust.
For the status bars, great if it could be configurable, and for vAmiga as well !
Cheers

@mithrendal
Copy link
Collaborator

mithrendal commented May 17, 2022

you can still scroll the keyboard by touching a key even in "exact timing" mode, this is not supposed to be the case I guess ?

hm ... on iPhone I cannot scroll on key caps in "exact timing" mode... how about vAmigaWeb on the z3 does it scroll there too ?

for the others lets make separate issues... I think I have to properly disconnect audio when it suspends ...I do not see this in iOS but this is maybe a bit OS specific some do handle this more robust than other ... when there is something as a suspend event then I could shut down sound ... we will address this in a separate issue what you think? status bar too... do you open ?

@Vweber73
Copy link
Author

On my Z3 vAmigaWeb has neither the keyboard scroll issue nor the sound issue, they are specific to vc64Web.
Ok, I open the issues.
Cheers

@mithrendal
Copy link
Collaborator

I found one difference between vAmigaWeb and vc64web codewise ... maybe that was the missing piece on the z3 ? Despite that I do not see this behaviour on iPhone and also not on a Windows11 with a touchscreen ...

I merged the spotted difference into vc64web... maybe it fixed it ?

@mithrendal mithrendal reopened this May 18, 2022
@Vweber73
Copy link
Author

It didn't, but sorry, I think i said something wrong. I tested again vAmigaWeb, and I could also scroll the keyboard with J and K keys. I suspect it is because since the Z3 is large, it could detect a gesture on the small empty space between the keys. Maybe the same on Ipad ?

@mithrendal
Copy link
Collaborator

mithrendal commented May 18, 2022

with "exact timing"...

Yes it could happen that a finger near the gap space between two key caps can trigger a native scroll ... but that is not that bad or am I wrong ?

The goal was NOT to disable the native scroll on key caps ... instead the goal was to free the key caps from all standard gestures (like context menu and text selection, drag and drop, scroll swipe ...) to get an ultra responsive keyboard 😎 ... as a side effect well the native scroll on key caps is no more ... so when it comes back partially because the browser engine/host OS thinks a finger is touching near a gap then I think this is totally fine for us ... I think the most important thing is that the key cap press/release is registered very accurate/exact

@Vweber73
Copy link
Author

Yes it is fine, no big deal ! :)

@mithrendal
Copy link
Collaborator

mithrendal commented May 18, 2022

with "mixed of both" we implemented an own gesture detection on key cap to be able to detect an intended scroll ... at the same time we trigger exactly at the same time a key press ... disadvantage here when we know that it is only an intended scroll we could not revoke the key press ... but the advantage is we are super fast when a key press is intended as we do away with all the native gesture thinking and evaluating

@Vweber73
Copy link
Author

I tried vc64web on my tiny ipod... Upon trying to move the keyboard (gigantic for the device), I got a sticky message on top of the screen: "exception thrown. See JavaScript console", although everything seems to continue to work...

@mithrendal
Copy link
Collaborator

mithrendal commented May 18, 2022

Upon trying to move the keyboard (gigantic for the device), I got a sticky message

good catch ... tomorrow I will look into it ...

today I did the support for exporting dh0 as hdf file see here vAmigaWeb/vAmigaWeb#86 I am so glad that this feature works so well ... playing monkey island hd version and I can save game state to hd and then I am able to export ... can import to winuae, fsuae, vAmiga or others so cool 😎

@mithrendal mithrendal reopened this May 18, 2022
@Vweber73
Copy link
Author

Excellent ! :) Only lacking is multi-drive support :)

@mithrendal
Copy link
Collaborator

mithrendal commented May 19, 2022

Upon trying to move the keyboard (gigantic for the device), I got a sticky message on top of the screen: "exception thrown. See JavaScript console", although everything seems to continue to work...

it does appear when keyup event fires on lowercase/uppercase key abc and ABC ... also on shift lock

thanks for reporting ... fix comes soon

@Vweber73
Copy link
Author

Perfect, thanks !

@mithrendal
Copy link
Collaborator

fixed 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants