[squeak-dev] How do I create a "synthetic" keyboard event?

Eduardo Ochs eduardoochs at gmail.com
Sun Feb 19 19:36:55 UTC 2023


Hi Karl,

I think that now I can give a more concrete example, and ask some
simpler questions. In one of my workspaces I have a variable "evt",
that holds a keyboard event with a CR that I captured using the
PolygonMorph of this e-mail,

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223469.html

and a variable "sb", that holds the morph of the search bar - a
PluggableTextMorphPlus. I discovered that I can simulate the action of
typing a CR on the search bar by running this,

  sb textMorph acceptContents.

but it took some time to discover that "textMorph acceptContents" was
the right message.

So: 1) how do I send my evt to the morph sb? 2) How do I modify my evt
to create an event that sends an 'a' instead of a CR?

I _think_ that once I learn the answers to (1) and (2) I'll be able to
perform certain tricks with the debugger and to use them to discover
what are the "actions associated to certain keys" very quickly. Do you
know how to do (1) and (2)?

  Cheers, more soon,
    Eduardo


On Sun, 19 Feb 2023 at 14:46, karl ramberg <karlramberg at gmail.com> wrote:

> To see events you can do it:
> HandMorph showEvents: true
>
> I'm not sure what you want to achieve seeing the events though...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230219/34004c1d/attachment.html>


More information about the Squeak-dev mailing list