<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I agree that we need to improve on this area. I don't have any
specific plans on how do do this. But this discussion is
interesting.<br>
<br>
The current code evolved from Squeak's without ever thinking too
much about it.<br>
<br>
We need to think a good sequence for dispatching events. Right now,
the most inner morph behind the hand (and on top of others) has the
choice to process events before owner. See MorphicEvent >>
dispatchWith:localPosition: . So, global keystrokes are handled
before this. If the World or the Hand processed events before other
morphs, all this could be easier to understand, extend, etc.<br>
<br>
The Hand could be a good "semi global" place to dispatch events to
the appropriate Morph. But if we do it by traversing the morph tree,
the natural place to start is the World.<br>
<br>
Let's keep thinking and discussing!<br>
<br>
Thanks,<br>
<br>
On 12/20/2020 2:02 AM, Luciano Notarfrancesco via Cuis-dev wrote:
<blockquote
cite="mid:CAL5GDyppYLkiXiD_8DDUxhfdkFAKecg55pkfErS4T+YioSusxQ@mail.gmail.com"
type="cite">
<div>
<div dir="auto" style="border-color: rgb(0, 0, 0); color: rgb(0,
0, 0);">I agree. I don’t want to change the way events work in
Morphic and I don’t want to add extra complexity, what I’m
proposing is to put the logic to handle a couple of global
shortcuts in HandMorph or a subclass instead of hardcode them
in the event classes. I wouldn’t even add preferences or
anything like that that would add more indirection.</div>
<br class="Apple-interchange-newline" style="color: rgb(0, 0,
0);">
</div>
<div><br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, 19 Dec 2020 at 10:36
PM, <<a moz-do-not-send="true"
href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.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;">On 2020-12-19 05:48, Mauro Rizzi via
Cuis-dev wrote:<br>
<br>
> Maybe we could have an object somewhere that contains a
collection of <br>
> possible keyboard event triggers and the action they
should perform?<br>
<br>
What happens now is that one uses mouseEnter and so forth
with the hand <br>
position to determine keyboard focus.<br>
<br>
I want context sensitive keys. E.g. Smalltalk edit bindings
vs <br>
game-move bindings depending on what object has the keyboard
focus. I <br>
think of this as typical and expected. Control is
distributed. Objects <br>
decide.<br>
<br>
To "steal" keys from the current keyboard focus object for
overriding <br>
keybindings would seem to require [1] a filter in the
KeyboardEvent <br>
class and [2] a protocol which can be overridden (like <br>
#allowsKeyboardOverrides) so that an object which really
wants keys <br>
(think gaming) can get all of them and then if it does not
want one <br>
re-delegates it back to the "global" bindings.<br>
<br>
Is the above better than what exists now? Does it carry its
own weight? <br>
[This is easy to implement, but adds code and is more
complex, and adds <br>
a new protocol which everyone needs to be aware of. There
needs to be a <br>
strong motivator for change.]<br>
<br>
Other options?<br>
<br>
$0.02<br>
-KenD<br>
<br>
</blockquote>
</div>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>