[Q] Learning Event
ducasse
ducasse at iam.unibe.ch
Sat Mar 30 20:14:16 UTC 2002
on 3/30/02 6:39 PM, Ned Konz at ned at bike-nomad.com wrote:
> On Saturday 30 March 2002 09:08 am, ducasse wrote:
>
>> But the morph to not get the key event. The browser still gets the event
>>
>> I'm sure I missed something. Any hint?
>
> You need to tell the Hand to set keyboard focus to you in your mouseEnter:
> method (and release it in your mouseLeave: method).
Thanks Ned without you.....
So that other people learn it I put an how in the wiki:
minnow.cc.gatech.edu/squeak/2415/
How to set up event handling so that a morph gets the keyboard event
Simple do the following:
handlesKeyboard: evt
^ true
mouseEnter: evt
evt hand keyboardFocus: self
mouseLeave: evt
evt hand releaseKeuboardFocus: self
keyDown: evt
evt keyCharacter ....doSomething
More information about the Squeak-dev
mailing list
|