On Wed, Jun 24, 2009 at 2:06 PM, Michael van der Gulik <mikevdg@gmail.com> wrote:
Hi all.

I'm writing my own EventSensor class (as part of Subcanvas: http://gulik.pbwiki.com/Canvas) and I'm looking at what the VM is doing.

When I press and release key under a recent Linux VM, I get three events:

#(2 512613 53 1 8 0 0 0)
#(2 512613 53 0 8 0 0 0)
#(2 512664 53 2 8 0 0 0)

The fields are (for those that don't already know this):

1: type (2=keyboard),
2: timestamp,
3: character in Mac Roman encoding,
4: key press/release (0=character, 1=press, 2=release)
5: modifiers (1=shift, 2=ctrl, 4=mac option, 8=cmd/alt)


On a random Windows VM I just found, I get even more interesting results:

#(2 14856453 72 1 0 72 0 0)
#(2 14856453 104 0 0 104 0 0)
#(2 14856500 72 2 0 72 0 0)

The character changes. I typed in a lower case 'h', but the VM returns an upper-case 'H' (72) as the press and release field character, and a lower case 'h' (104) in the character field.

Why?

And why is the character repeated in the 6th field?

Also, under the Windows VM, modifier key pressed and releases /are/ sent to the VM.

Gulik.

--
http://gulik.pbwiki.com/