[Cuis-dev] keyboard events in custom morph

Mark Volkmann r.mark.volkmann at gmail.com
Thu Aug 1 13:44:42 PDT 2024


I'm able to get mouse events in a custom morph, but I haven't been able to
do the same for keyboard events. Here is what I tried:

I created a subclass of PlacedMorph.

In the initialize method I have this:

initialize
    super initialize.
    self setProperty: #handlesKeyboard toValue: true.

In the keyDown: method I have this:

keyDown: aKeyboardEvent
    'got keyDown' print.

I create an instance of my custom morph in a Workspace and send it
#openInWorld to render it.
I then move the mouse over it and press a key, but I don't see output in
the Transcript.
Does anyone see what I'm missing?

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240801/f553c0dd/attachment.htm>


More information about the Cuis-dev mailing list