[squeak-dev] Re: VM side EventSensor design questions

Andreas Raab andreas.raab at gmx.de
Wed Jun 24 04:52:29 UTC 2009


Michael van der Gulik wrote:
> 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?

Look at your keyboard. Real close. What does the letter that is printed 
on the keyboard say? Does it say "h" or does it say "H"? ;-)

When you press the "H" key (as it is denoted on your keyboard) the VM 
reports this as the "H" key which is then interpreted by Windows to be 
the lowercase "h" character, which it reports as well. Similarly, if you 
would press Shift-H, it would report that you pressed the shift key, the 
"H" key which then resulted in the uppercase "H" character. Makes sort 
of sense dunnit? ;-)

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

Because the Windows VM is fully Unicode capable and produces both 
MacRoman as well as UTF-32 for maximum compatibility.

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

Yes, indeed. You are pressing that shift key, no? Why would the VM not 
report that? Might as well decide not to report the Q key ;-)

Cheers,
   - Andreas




More information about the Squeak-dev mailing list