Virtual Keyboard typing too fast for engine

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
stoo
Posts: 4
Joined: Thu Feb 15, 2018 6:51 am
Location: Scotland

Virtual Keyboard typing too fast for engine

Post by stoo »

ScummVM 2.0.0 stable
Raspbian port (SDL2) running on RPi3B
Built from source with vkbd support
I am not a coder.

--

In certain games the virtual keyboard seems to enter keystrokes faster than the engine can register them. I first noticed it when trying to enter a save game name in BASS, but it happens elsewhere too.

I saw a thread from 2012 where tsoliman identified the issue and suggested a hack. The tree with the hack is long gone so I don't know what his suggestion was.

I am struggling to think of a way to fix this without std libs (like throwing a udelay in virtual-keyboard.cpp and crossing my fingers). Is there a better way of resolving this?

Edit: man it's been a long time since I used bbcode
stoo
Posts: 4
Joined: Thu Feb 15, 2018 6:51 am
Location: Scotland

Re: Virtual Keyboard typing too fast for engine

Post by stoo »

stoo wrote:Is there a better way of resolving this?
First person to say "use a real keyboard" gets shot, btw.
dafioram
Posts: 33
Joined: Sat Sep 24, 2016 5:10 pm

Post by dafioram »

You may find things a lot easier if you use retropie. They have prebuild images https://retropie.org.uk/download/ or you can build retorpie ontop of your current setup https://retropie.org.uk/docs/Manual-Installation/. Currently stretch is experimental with retropie.

You can install scummvm from retropie by going to optional programs and building it from source (to get scummvm 2.0.0 or some other version).

The vkeybd worked fine for me when I used it in retropie.
stoo
Posts: 4
Joined: Thu Feb 15, 2018 6:51 am
Location: Scotland

Post by stoo »

Hi dafioram,

I am using RetroPie. I'm using 2.0.0 as that's the latest in the RetroPie repo.

Feel free to test it yourself. Open the save menu in BASS and try to enter a save name. It will enter exactly one character, the last character in the string, and the rest will be lost, because it can't accept keyboard entry at the speed the vkbd does it.

Same thing happens in Simon the Sorcerer when you try to enter a name for a save game.
dafioram
Posts: 33
Joined: Sat Sep 24, 2016 5:10 pm

Post by dafioram »

Good find, its not just for raspberry pi though. I reported it here: https://bugs.scummvm.org/ticket/10439.
stoo
Posts: 4
Joined: Thu Feb 15, 2018 6:51 am
Location: Scotland

vkbd backend, not engine-specific

Post by stoo »

Thanks, dafioram.

To my primitive understanding: fixing this without some kind of delay inserted between keystroke events would require that affected engines fired an event on keystroke "completion" that vkbd could wait for. As it stands, the vkbd processes KEYUP and KEYDOWN events as fast as possible which isn't ideal.

So far I've found the problem occurs in eob, eob2, simon1, sky. It probably occurs in other games, I just haven't tested them yet.

Might be helpful to make clear in the ticket that it's not a bug with a particular engine.
Post Reply