[Vm-dev] Incorrect keyUp events on SqueakVM (was: Where are precompiled stack VMs or interpreter VMs?)

David T. Lewis lewis at mail.msen.com
Thu Jan 13 03:13:34 UTC 2011


On Wed, Jan 12, 2011 at 06:47:05PM -0800, Eliot Miranda wrote:
>  
> Hi David,
> 
> On Wed, Jan 12, 2011 at 6:38 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> >
> > (changing subject line to reflect new topic)
> >
> > Thanks Matthew,
> >
> > This is now Mantis 7597: "keyUp events reported incorrectly on SqueakVM".
> >  http://bugs.squeak.org/view.php?id=7597
> >
> > Eliot, by any chance do you recall fixing this? Symptoms are
> > that a keyUp event is reported for the most recently depressed key,
> > rather than for the key that is actually being released. It works
> > properly on Cog, and has apparently been broken for some time on
> > SqueakVM.
> >
> 
> Which platform?  I infer linux.  [Please can we be more informative in these
> discussions.  It's hard trying to follow all the VM bugs when people don't
> specify the platform. please :)]

Matthew reports that it occurs on mac and linux but he has not tried
Windows. I confirmed it on Linux. I wrote it up on Mantis as follows:

  The standard VM reports keyUp events incorrectly if two keys are
  depressed. The keyUp event is reported for the most recently depressed
  key, not for the key that is actually being released. Works correctly
  on Cog, defect exists for standard VM on unix and Mac (not sure for
  Windows). 

> I did do a fair amount of work on the linux keyboard handling for
> Teleplace's linux client.  G?ran is finding out some "infelicities" in my
> code, like not answering the right release code for a
> shiftPress-keyPress-shiftRelease-keyRelease sequence.  So while it might be
> better than the standard VM it is far from perfect.  Also, the X11 keyboard
> handling code is, um, /complex/.

Thanks, that helps narrow it down.

> 
> On this tack, on the Mac I notice that the VM isn't sending key-down and
> key-up events separately but instead sends a key-down, key-up pair when a
> key is released, which makes it difficult to do raw keyboard stuff where one
> has to detect if the shift key is dow.  e.g. if one does shiftPress,
> keyPress, keyRelease, shiftRelease then that arrives in the image as
> keyPress, keyRelease, shiftPress, shiftRelease, and so the shift key appears
> /not/ to be pressed when the key is.  John, is there any fundamental reason
> why this is?  I see the Vm code is explicit about doing this but would
> anything (apart from lots of existing image code) break if it were fixed?
>  And is it fixed in the iOS code?
> 
> TIA
> Eliot
> 
> 
> > Dave
> >
> >
> > On Wed, Jan 12, 2011 at 08:30:47PM -0500, Matthew Fulmer wrote:
> > >
> > > On Wed, Jan 12, 2011 at 12:15:22PM -0500, David T. Lewis wrote:
> > > >
> > > > On Tue, Jan 11, 2011 at 12:45:14PM -0500, Matthew Fulmer wrote:
> > > > >
> > > > > - Keyboard Up events are incorrect when multiple keys are
> > > > >   pressed at once. The latest vm's on squeakvm.org fail,
> > > > >   however, they are nearing a year old, and the cog VMs (all
> > > > >   newer) don't have this bug.
> > > >
> > > > I'm not familiar with the Keyboard Up event issue. Can you say
> > > > how to reproduce this, preferably with a Squeak trunk image?
> > > > Sorry if this was discussed before, but I don't recall it.
> > > >
> > > > I was not anticipating any further changes to the interpreter VM
> > > > until after this round of "official" builds, but this one sounds
> > > > like it may be important.
> > >
> > > File in the attached changeset. (don't show keystroke events)
> > >
> > > do: "HandMorph showEvents: true"
> > >
> > > quickly, press A, press B, release A, release B.
> > >
> > > you should see these flash by the top-left corner of the screen,
> > > and on Cog, this is what you see:
> > >
> > >     [keyDown 'a']
> > >     [keyDown 'b']
> > >     [keyUp 'a']
> > >     [keyUp 'b']
> > >
> > > on the official VMs, you instead see this:
> > >
> > >     [keyDown 'a']
> > >     [keyDown 'b']
> > >     [keyUp 'b']
> > >
> > > (you can of course use any two keyboard buttons)
> > >
> > > It's an issue on mac and linux at least. Not sure about windows
> > >
> > > --
> > > Matthew Fulmer (a.k.a. Tapple)
> >
> >



More information about the Vm-dev mailing list