Some Sensor refactorings ?

Bert Freudenberg bert at
Sun Nov 13 22:30:25 UTC 2005

Am 13.11.2005 um 21:40 schrieb Serge Stinckwich:

> Hi all,
> i started to look at the Sensor stuff. I have two questions :
> - there is two classes : EventSensor and InputSensor. The first one  
> seems to be a replacement of the last one. Do we really need two  
> classes or could we try to merge both ?

IMHO there's nothing wrong with having both classes. In a minimal  
image / VM the old polling InputSensor should actually still work.  
Which is good for getting new ports started. If the VM implements the  
event primitives, the EventSensor will take over.

Merging the two into one class would really lead to more obscure  
behavior. It actually *is* well factored ;-)

> - there is an EventSensorConstants shared pool with several  
> constants used only by the EventSensor class. Is this class realy  
> needed or we could move the constants as class variables in the  
> EventSensor class ?

Why do you think they are unused? In my image I see these users:

EventSensorConstants "is a global variable.  It is a pool which is  
used by the following classes (CHandPlayer CHandCostume EventSensor  
CUnknownEvent UserInputEvent KeyboardInputInterpreter TextConverter  
MorphicUnknownEvent CUserInputEvent HandMorph)"

- Bert -

More information about the Squeak-dev mailing list