Case of EventSensor keystrokes on Windows.
Andreas Raab
andreas.raab at gmx.de
Sat Dec 3 18:45:05 UTC 2005
Joshua Gargus wrote:
> Does anyone know why the Windows VM would generate an uppercase
> keystroke event when you type a letter without shift pressed? This
> seems to be a bug, no?
No. #keyDown and #keyUp correspond to *keys* that are on your keyboard,
not to *characters* syntesized from those keys. In other words, when you
press Shift-D you will see the following series of events:
- keyDown: <shift>
- keyDown: <D>
- keyStroke: 'D'
In other words: An uppercase *character* D is a combination of the *key*
labeled 'shift' and the *key* labeled 'D' on your keyboard. Also, there
is no guarantuee whatsoever that the codes generated in keyDown/keyUp
have any correspondance to characters (since there is neither an ascii
value for shift, nor for printscreen, volume controls, whatever - all of
which are keys that are supported by keyDown/keyUp). On Windows, the key
codes for the alphanumeric keys correspond to the label on that key -
and that's why you get capital characters (since the keyboard is labeled
with caps).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|