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

John M McIntosh johnmci at smalltalkconsulting.com
Thu Jan 13 03:16:50 UTC 2011


The complex key up/down/char code is per Andreas historical intent for windows.  See the commentary in http://isqueak.org/ioGetNextEvent

The modifier keys were not an event on os-9, they were inferred by add them to mouse coordinate data which then would be processed by the event polling in the image. 
On os-x those do come in as events, and we painfully attempt to adhere to the windows standard.

Also btw windows has many flaws for multi-stroke dead key input where you have to figure out the mac os key code, the virtual key, or the unicode.  On the mac we can supply all three at any point, but were told that is impossible under windows.  

Likely changes would cause tweak to die as it has a different opinion of how the intent of the character is arrived at versus squeak. 

On 2011-01-12, at 6:47 PM, 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 :)]
> 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/.  
> 
> 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)
> 
> 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110112/f3d1bc1b/attachment-0001.htm


More information about the Vm-dev mailing list