Pen-based operation

Yoshiki Ohshima ohshima at is.titech.ac.jp
Wed Jul 12 10:05:56 UTC 2000


  Hi,

> OTOH, this only influences the location of the starting point in the
> simple drawing tool. The Right Thing to do would obviously be answering
> the actual mouseDownPoint (if we had such a method) instead of querying
> the current cursorPoint after the delay.

  I think it is not obvious.  When I count "the number of
pen-points/sec" by the following code ("do-it" the code and
move the pen for a while on the screen),

--------------
[Sensor yellowButtonPressed] whileFalse: [
    Sensor waitButton.
    i _ 0.
    prev _ now _ 0 at 0.
    start _ Time millisecondClockValue.
    [Sensor redButtonPressed] whileTrue: [
        (now _ Sensor cursorPoint) ~= prev ifTrue: [i _ i + 1]. 
        prev _ now.
    ].
    (time _ Time millisecondClockValue - start) printString,
     '     ', (i asFloat / time * 1000) printString, '    ' displayAt: 0 at 0
]
--------------

the result on the current Squeak/Zaurus is around 40.  So, I
could miss not only the first one, but two or three if the
delay is 50 milliseconds.

# By the way, I found that 40 is fine, but not enough for
# pen drawing.  I'd like to know the results on the other 
# platforms.

  Or what you suggest here is a kind of event based
implementation, where the VM buffers the pen events.  In
that case, the Squeak side code could not be fast enough to
"consume" the events so that the Squeak code can't track the
user operation.

  -- Yoshiki





More information about the Squeak-dev mailing list