<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Feb 2023 at 15:18, Eduardo Ochs <<a href="mailto:eduardoochs@gmail.com">eduardoochs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Karl,<br><br>ouch, so my plan is completely wrong... it was roughly this: 1) learn<br>how to create synthetic keyboard events, 2) learn how to send these<br>events to morphs with the debugger turned on, 3) use that to find the<br>actions associated to typing certain keys in certain places, 4) become<br>less of a beginner...<br><br>I installed your two .mczs and tried this,<br><br>  EventRecordingSpace open<br><br>and I got this error after just a few keys and mouse clicks:<br><br>  MouseButtonEvent(Object)>>doesNotUnderstand: #eventType</div></div></blockquote><div dir="auto"><br></div><div dir="auto">Hm. </div><div dir="auto">#eventType must be charged to #type</div><div dir="auto"><br></div><div dir="auto">I thought I had found all occurrences in the fix I made</div><div dir="auto"><br></div><div dir="auto">I’ll answer the other questions when I get home</div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto">Karl</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><br><br>I also took a look at the snapshot/<a href="http://source.st" target="_blank">source.st</a> in the .mcz with Emacs<br>(!!!). I search for "keyboardevent" there case-insensitively, and<br>found very few occurrences - and none of them very enlightening...<br>"keystroke" has lots of occurences, but same.<br><br>Can I ask you for some suggestions and hints?<br><br>  a) How do you do my (3) above, i.e., "use that to find the actions<br>     associated to typing certain keys in certain places"?<br><br>  b) I've tried to learn Etoys, but many links are broken, many<br>     packages too, the mailing lists and forums look dead, and the<br>     tutorials that I could access feel very incomplete to me... for<br>     example, the link [1] below only has the videos 1, 10, 20, and<br>     30, [2] has lots of steps that took me many hours to decypher,<br>     and [3] shows ways to script and connect etoys that I don't have<br>     any idea how to do myself... when you convince people to learn<br>     Etoys what are the resources - including forums and mailing lists<br>     - that you recommend?<br><br>Thanks in advance...<br>  Eduardo Ochs<br>  <a href="http://anggtwu.net/eev-squeak.html" target="_blank">http://anggtwu.net/eev-squeak.html</a><br><br>[1] <a href="http://www.squeakland.org/tutorials/screencasts/" target="_blank">http://www.squeakland.org/tutorials/screencasts/</a><br>[2] <a href="http://www.squeakland.org/content/articles/attach/The_Etoys_Quick_Guides.pdf" target="_blank">http://www.squeakland.org/content/articles/attach/The_Etoys_Quick_Guides.pdf</a><br>[3] <a href="https://wiki.squeak.org/squeak/3913" target="_blank">https://wiki.squeak.org/squeak/3913</a> Game programming with Etoys<br></div></div><div dir="ltr"><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Feb 2023 at 06:18, karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>General events are a little tricky to set up and generate like you describe.</div><div><br></div><div>But there are tools to help you.</div><div><br></div><div>You can load these two fixes and use EventRecordingSpace.<br></div><div>
<a href="http://source.squeak.org/inbox/EToys-kfr.493.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/EToys-kfr.493.mcz</a>

</div><div>
<a href="http://source.squeak.org/inbox/EToys-kfr.494.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/EToys-kfr.494.mcz</a></div><div><br>


</div><div>EventRecordingSpace open</div><div><br></div><div>You can record all events inside for later playback and editing saving etc. <br></div><div><br></div><div>Best,</div><div>Karl<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 19, 2023 at 4:43 AM Eduardo Ochs <<a href="mailto:eduardoochs@gmail.com" target="_blank">eduardoochs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi list,<br>
<br>
this is a follow-up to these two messages:<br>
<br>
<a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223407.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223407.html</a><br>
<a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223408.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223408.html</a><br>
<br>
The first one was a question that I asked, and the second was an<br>
answer by Marcel Taeumel. I was able to decypher almost all his<br>
pointers - but not yet this one:<br>
<br>
  HandMorph >> #generateKeyboardEvent:<br>
<br>
I am using this code:<br>
<br>
  a := Array with: 50@100 with: 200@300 with: 100@400.<br>
  b := (PolygonMorph<br>
          vertices: a color: Color red<br>
          borderWidth: 1 borderColor: Color black).<br>
  World addMorph: b.<br>
<br>
  b beSmoothCurve.<br>
  b beStraightSegments.<br>
<br>
  b vertices.<br>
  b vertices at: 1.<br>
  b vertices at: 1 put: 40@100.<br>
  b vertices at: 1 put: 50@100.<br>
  b vertices at: 1 put: 40@100. b computeBounds.<br>
  b vertices at: 1 put: 50@100. b computeBounds.<br>
<br>
  b color.<br>
  b color: Color banana.<br>
  b color: Color red.<br>
<br>
  e := EventHandler new.<br>
  b eventHandler.<br>
  b eventHandler: nil.<br>
  b eventHandler: e.<br>
<br>
  bl := [ :a :b | { a . b }].<br>
  bl := [ :a :b | Transcript show: { a . b }; cr. ].<br>
  bl numArgs.<br>
  bl value: 2 value: 3.<br>
  bl perform: #value:value: with: 2 with: 3.<br>
<br>
  bl := [ :evt :sm | Transcript show: { evt . sm }; cr. ].<br>
  bl := [ :evt :sm | Transcript show: { evt keyValue . sm }; cr. ].<br>
  bl := [ :evt :sm | self halt. ].<br>
  e on: #keyStroke send: #value:value: to: bl.<br>
  b currentHand newKeyboardFocus: b.<br>
<br>
It is meant to be used in a workspace. By selecting the right parts of<br>
it and running them with "do it"s or "print it"s in the right order I<br>
can create a PolygonMorph, some EventHandlers, and some blocks, and<br>
then I can make the PolygonMorph react to keyboard events in different<br>
ways. The last line switches the keyboardFocus to my PolygonMorph, and<br>
then I can send several keystroke events to my PolygonMorph, and<br>
inspect their events either on the transcript or on the debugger.<br>
<br>
Question: suppose that evt is an event whose printed representation is<br>
this one:<br>
<br>
  [79@273 keystroke ' ' (32) 956759]<br>
<br>
I know that this means that:<br>
<br>
  evt position -> 79@273<br>
  evt type -> #keystroke<br>
  evt keyValue -> 32<br>
  evt keyCode -> 32<br>
  evt source -> self currentHand<br>
  evt timeStamp -> 956759<br>
<br>
How do I write code that creates an event like that? I would like to<br>
create, ahem, "synthetic keystrokes", and experiment with sending them<br>
to certain morphs...<br>
<br>
  Thanks in advance!<br>
    Eduardo Ochs<br>
    <a href="http://anggtwu.net/eev-squeak.html" rel="noreferrer" target="_blank">http://anggtwu.net/eev-squeak.html</a><br>
<br>
</blockquote></div>
<br>
</blockquote></div></div>
<br>
</blockquote></div></div>