[squeak-dev] Unix keyboard events lose track when multiple keys pressed or keys held down

tim Rowledge tim at rowledge.org
Mon Jan 18 22:59:37 UTC 2021



> On 2021-01-18, at 12:08 PM, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:
> 
> My understanding is that we want to achieve a perfect order, whenever
> buffered keys x & y do not compose:
> KeyPress x
> KeyChar x
> KeyPress y
> KeyChar y
> KeyRelease x
> KeyRelease y
> 
> rather than:
> KeyPress x
> KeyPress y
> KeyChar x
> KeyChar y
> KeyRelease x
> KeyRelease y
> 
> Is that it?
> If we would accept second form, code would be much simpler.
> 
> 
Honestly, I don't know how to even decide if one way is more meaningful than the other for this case. 

For the very narrow purposes of my work on updating/correcting NuScratch the key (hah!) is to make sure that tracking the state of the simple alphanumeric + cursor keys is accurate and timely. It will help with any sort of game/keyboard-music application too. 

As soon as we consider any of the multiple-gesture characters like é or composited ones like (I imagine this delightful 'man disco dancing' from the Mongolian alphabet is) ᡲ then what to do becomes... complicated. I'd say the important thing is to make sure that at least everything is balanced so that after all the keys are pressed, held, and released, anyone using a KeyboardListener will see no keys being still down.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: SG: Show Garbage




More information about the Squeak-dev mailing list