Sensor vs. Hand (was: Re: Squeak-3.7: Title-Bar Buttons)
Trygve Reenskaug
trygver at ifi.uio.no
Mon Feb 23 09:36:09 UTC 2004
Andreas,
So when you say:
"NEVER, NEVER use Sensor. DO NOT EVER USE IT! Refer to the hand instead."
is this is a short way of saying:
" Never use sensor. Extend HandMorph with your own code instead. "?
1) IMO, it is not a good idea to extend basic library classes in simple
applications. The surface area between the evolving Squeak releases and my
own applications become very large and very hard to handle. It will #^@!
things up.
3) Aren't you overselling a bit when you suggest replacing Sensor with
HandMorph in applications? A quick check indicates that Sensor understands
76 messages that are missing from HandMorph. Examples: #(#anyButtonPressed
#anyModifierKeyPressed #blueButtonPressed #buttons #characterForKeycode:
#commandKeyPressed #controlKeyPressed #createMouseEvent #currentCursor
#currentCursor: #cursorPoint: #eventQueue #eventQueue: ...
Need really all of them be harmful to Morphic? I have used Sensor when I
need the current state of mouse and keyboard, and events when I need the
state at a certain time. Following your advice, it looks as if I have to do
a lot of low-level programming to maintain contact with the input devices.
4) Finally: After a couple of hours frustrating archeology into Squeak, I
wonder if a good solution could be to say
CurrentHand lastEvent shiftPressed, (or controlKeyPressed or whatever)
If this is what you meant, you could have saved me a lot of irritating work
by saying so in the first place.
There are 51 messages understood by Sensor and not by either HandMorph or
MouseEvent. They all seem to be state changing and it makes sense to
replace Sensor by _CurrentHand_ and _CurrentHand lastEvent_ in Morphic.
cheers
--Trygve
At 22.02.2004 17:15, you wrote:
>HandMorph>>shiftPressed
> ^lastMouseEvent shiftPressed
>
> - A.
>
>----- Original Message -----
>From: "Trygve Reenskaug" <trygver at ifi.uio.no>
>To: "The general-purpose Squeak developers list"
><squeak-dev at lists.squeakfoundation.org>
>Sent: Sunday, February 22, 2004 4:40 PM
>Subject: Re: Sensor vs. Hand (was: Re: Squeak-3.7: Title-Bar Buttons)
>
>
>Andreas,
>This may be good advice, except that ActiveHand (HandMorph) does not
>understand shiftPressed. I'm running 'Squeak3.6'.
>
>regards
>--Trygve
>
>
>At 21.02.2004 19:13, you wrote:
> >thanks for the advice I will change everything for my book.
> >
> >Stef
> >
> >On 21 févr. 04, at 18:52, Andreas Raab wrote:
> >
> >>
> >>The bottom line of this is: If you are programming for Morphic, NEVER,
>NEVER
> >>use Sensor. DO NOT EVER USE IT! Refer to the hand instead. Changing
> >>TransferMorph>>step to say:
> >>
> >>step
> >> self shouldCopy: ActiveHand shiftPressed.
> >>
> >>entirely eliminates that problem (regardless of any error handler). Again,
> >>if you write code for Morphic DO NOT REFER TO SENSOR! It will just #^@!
> >>things up.
> >>
> >>Cheers,
> >> - Andreas
>
>
>--
>
>Trygve Reenskaug mailto: trygver at ifi.uio.no
>Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver
>N-0378 Oslo Tel: (+47) 22 49 57 27
>Norway
--
Trygve Reenskaug mailto: trygver at ifi.uio.no
Morgedalsvn. 5A http://heim.ifi.uio.no/~trygver
N-0378 Oslo Tel: (+47) 22 49 57 27
Norway
More information about the Squeak-dev
mailing list
|