<div dir="ltr">I got tabbing between <font face="monospace">TextModelMorph</font> instances to work!<div>It did require a small change to <font face="monospace">InnerTextMorph</font> though.</div><div>I modified the following line in the <font face="monospace">processKeystrokeEvent</font> method:<div><br></div><font face="monospace">self handleInteraction: [ editor processKeystrokeEvent: evt ]<br></font><div><br></div><div>replacing it with this:</div><div><br></div><div><font face="monospace">evt keyValue = 9 ifFalse: [<br> self handleInteraction: [ editor processKeystrokeEvent: evt ]<br> ].</font><br></div><div><br></div><div>This is demonstrated in the package I created at <a href="https://github.com/mvolkmann/Cuis-Smalltalk-Greeter">https://github.com/mvolkmann/Cuis-Smalltalk-Greeter</a>.</div></div><div>The attached screenshot shows the window that is opened when you open the World menu, hover over Open, and click Greeter.</div><div>There are two <font face="monospace">TextModelMorph</font>s.</div><div>Pressing the tab key while in the first moves focus to the second.</div><div>Pressing shift-tab while in the second moves focus back to the first.</div><div><br></div><div>The key is this block that is used in the <font face="monospace">keystrokeAction:</font> of each <font face="monospace">TextModelMorph</font>.</div><div><br></div><div><font face="monospace">handleTab := [ :evt |<br> | isTab |<br> <br> isTab := evt keyValue = 9.<br> isTab ifTrue: [<br> evt buttons = 8 "shift key"<br> ifTrue: [ evt hand keyboardFocusPrevious ]<br> ifFalse: [ evt hand keyboardFocusNext ]<br> ].<br> isTab.<br> ].</font></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025 at 3:06 PM Mark Volkmann <<a href="mailto:r.mark.volkmann@gmail.com">r.mark.volkmann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Juan! I'll see if maybe I can create a subclass of TextModelMorph that has that behavior. Perhaps each instance of the subclass can hold a reference to another morph that should take focus when the tab key is pressed. Maybe I can create a set of morphs that have that ability such as checkboxes, radio buttons, and so on. That would enable creating user interfaces that are completely keyboard-driven as is common in web interfaces.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2025 at 3:01 PM Juan Vuletich <<a href="mailto:juan@cuis.st" target="_blank">juan@cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>
<div bgcolor="#ffffff">
On 1/24/2025 9:17 PM, Mark Volkmann via Cuis-dev wrote:
<blockquote type="cite">
<div dir="ltr">
<div>In Cuis Smalltalk using Morphic morphs, is there a
relatively easy way to enable using the tab key to move focus
between text inputs like TextModelMorph instances?</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Not really, because tab is a valid character in TextModelMorph. See
#keyboardFocusPrevious and #keyboardFocusNext . Maybe tab could be
disabled as a character for specific morphs, so we can enable it for
focus control.<br>
<br>
Cheers,<br>
<pre cols="72">--
Juan Vuletich
<a href="http://cuis.st" target="_blank">cuis.st</a>
<a href="http://github.com/jvuletich" target="_blank">github.com/jvuletich</a>
<a href="http://researchgate.net/profile/Juan-Vuletich" target="_blank">researchgate.net/profile/Juan-Vuletich</a>
<a href="http://independent.academia.edu/JuanVuletich" target="_blank">independent.academia.edu/JuanVuletich</a>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a>
<a href="http://linkedin.com/in/juan-vuletich-75611b3" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a>
<a href="http://twitter.com/JuanVuletich" target="_blank">twitter.com/JuanVuletich</a></pre>
</div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>