Reading keyboard state

Norton, Chris chrisn at Kronos.com
Fri Dec 3 20:31:23 UTC 1999


------_=_NextPart_000_01BF3DCD.5DC3C280
Content-Type: text/plain


Hi Hendrik.

Re: "AFAIK, there is no way to get the current keyboard state for the
regular alphanumeric keys, like you can for modifier keys and mouse
buttons."

I don't know much about general keyboard processing in Squeak, but here's an
example of how you can teach a morph to sense and respond to a key pressed.

Steps: 
1.  File in the attached change set.
2.  Create a new KeyboardMorphTest (in Morphic, World Menu>>new
morph...>>from alphabetical list>>k>>KeyboardMorphTest)
3.  Put your mouse cursor over the new morph and press any key (only keys
with visible characters will be interesting)
4.  A balloon will pop up telling you what key you pressed.

Cheers!

---==> Chris

 <<KeyboardTestMorph.st>> 


------_=_NextPart_000_01BF3DCD.5DC3C280
Content-Type: text/plain; name="KeyboardTestMorph.st"
 ; x-mac-type="65417070"
 ; x-mac-creator="43534F6D"
Content-Disposition: attachment; filename="KeyboardTestMorph.st"
Content-Transfer-Encoding: imap_stub

0,1990,2,1252,0,

------_=_NextPart_000_01BF3DCD.5DC3C280--





More information about the Squeak-dev mailing list