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

Igor Stasenko siguctua at gmail.com
Wed Jun 24 05:07:30 UTC 2009


There are a Windows API functions, which can be helpful for handling a
keyboard input almost independetly from windows messaging
implementation.

There are two useful function, which, when use the wisely could
replace the keyboard input handling:
GetKeyboardState
- fills an array with each key state (down/up + swither on / swithed off)

MapVirtualKey
- this function maps between key code <==> virtual key

so, you can implement a keyboard repeat in image, while in VM,
generate only keydown/keyup events.


2009/6/24 Andreas Raab <andreas.raab at gmx.de>:
> 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
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list