[squeak-dev] Mouseover on a touch screen

Jim Rosenberg jr at amanue.com
Thu Dec 24 19:19:35 UTC 2009

For many years now I have created artistic content that makes intensive use 
of mouseovers. About a year ago I got a Nokia N810, and played a bit with 
Squeak on that device. I've still not recovered from the shock of realizing 
that on a touch screen, there is no such thing as mouseover!: you cannot 
get the mouse cursor to move without putting it down. What to do.

I can think of two potential approaches to this problem.

1. Subclass or modify HandMorph to "do the right thing in the right 
circumstances". Clearly some work has to be done to clarify how this should 
behave. HandMorph seems quite complex -- I don't suppose someone has 
written a tutorial on it somewhere?

2. A new class which acts as a mouse event proxy. This could either be a 
"screen" -- something that would fit over an entire PasteUpMorph -- or a 
"sled" that would be carried around by a HandMorph.

In any case, the obvious question is: how should it behave. I haven't 
really specified this yet, but a rough idea would be something like this: 
"it" absorbs mouseDown, and records what morph would receive mouseDown if 
it weren't there. If a mouseUp occurs that would have been given to the 
same morph then mouse events are replayed and sent to that morph. 
Otherwise, "it" has to relay mouse events to whatever underlying morph 
would have gotten them if it were not there. This may not be simple to 

Now I've only poked around a little, and it looks to me as though the code 
for deciding what morph should get an event is in HandMorph. So, if I'm 
serious about doing something, regardless of how I do this it looks like I 
will need to get deep into the workings of HandMorph.

I've tended to want to do my custom stuff in Squeak by subclassing, and am 
inclined to do approach 2 above -- at this point I kind of like the idea of 
a "screen". Am I reinventing a wheel here? If someone knows of work I 
should look at, I'd appreciate any references.

There's a major psychological difference between a mouseOver and a click. 
The click is a kind of commitment, which a mouseOver isn't. It would be a 
real shame to have to say that we just have to give up mouseOvers on touch 
screens. I'm not prepared to do that.

-Thanks, Jim

 Jim Rosenberg                      http://www.well.com/user/jer/
     Internet: jr at amanue.com

More information about the Squeak-dev mailing list