[squeak-dev] How do I translate "sendKeyboardEvent: CR" to real code?

Marcel Taeumel marcel.taeumel at hpi.de
Fri Feb 3 15:03:46 UTC 2023


Hi Eduardo --

Maybe take a look at
   UserInputEventTests >> #keystroke:at:

Best,
Marcel
Am 03.02.2023 15:24:33 schrieb Eduardo Ochs <eduardoochs at gmail.com>:
Hi list,

suppose that I am exploring a morph and want to use the debugger to
understand what happens when I send a CR to one of its submorphs. I
guess that a good way to do that would be to run a one-liner like this
in the explorer window,

42 halt. (self submorphs at: 1) sendKeyboardEvent: CR.

but this is just pseudo-code, of course... I've spent some hours on
the swiki and browsing the source code of methods and classes that
looked promising, like these ones,

EventSensor>>#processKeyboardEvent:
HandMorph>>#generateKeyboardEvent:
HandMorph>>#sendKeyboardEvent:
KeyboardEvent

but I couldn't find any code that generates a keyboard event itself
and sends it to a morph... I know how to add a breakpoint to a
keyDown: method, but debugging that breakpoint would start the
debugger in a place in which a keyboard event had already been
generated, and is being processed - and I'm looking for a way to do
something that is several steps before that (break)point.

Any hints? Translations of the "sendKeyboardEvent: CR" above to real
code - either low-level or high-level - would be ideal, but links
can help me a lot too, of course...

Thanks in advance!
Eduardo Ochs
http://anggtwu.net/eev-squeak.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230203/f3189f81/attachment.html>


More information about the Squeak-dev mailing list