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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Jan 18 20:08:34 UTC 2021


Le lun. 18 janv. 2021 à 20:09, tim Rowledge <tim at rowledge.org> a écrit :
>
>
>
> > On 2021-01-18, at 10:40 AM, David T. Lewis <lewis at mail.msen.com> wrote:
> >
> > I think I found a clean way to handle the missing key up event problem.
> > I have it working in the interpreter VM now and I'll do a pull
> > request for opensmalltalk-vm either today or tomorrow.
>
> I was thinking of a similar approach at the end of last week too; if one records the ingoing charcode for a keycode then you can return it once again on a release. I got stuck trying to remember enough C to write what would be trivial in Smalltalk...
>
> I think one of the 'interesting' problems is having a good heuristic for what happens with multiple-key cases. Say you have some input that requires ctl-e-e-opt-s or some similarly convoluted gesture. That gets you a single character input event. When do you provide the release event for that single character? Is there even a real meaning to holding down that final 'opt-s' - and what if the opt is released before the s? Do the composited characters do repeats if the opt-s is held down?
>
> My brain will likely never fully recover from this assault.
>
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Computer Science: solving today's problems tomorrow.
>
>

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.


More information about the Squeak-dev mailing list