Event implementation

Raab, Andreas Andreas.Raab at disney.com
Wed Nov 1 08:13:25 UTC 2000


Marcel,

> I've been trying to implement the event-processing VM extensions,

On what platform?!

> Things that I am unclear about are the exact meaning (units?) of the  
> timestamp value in the event structure,

Milliseconds. Will be used (at some point) to determine double clicks etc.
more accurately. If possible, they should be based on your system's
io[Micro]MSecs() implementation, so it's easy to determine from Squeak how
old this event is.

> as well as what types of events are expected. 

Whatever your OS gives you. Mouse down, mouse up, mouse move, key down, key
up [*], character.

[*] The exact semantics for what to report on key down/key up haven't been
figured out yet. My current take is to simply use the X11 key definitions
since at least Mac/Win seem to be a subset of it and since X11 keys are
16bit and Mac/Win only 8bit the mapping is relatively straightforward and
not too expensive in terms of memory. Alternatively, we could report
*whatever* your system gives you wrt to key codes and do the mapping from
Squeak. Both approaches have its advantages...

> For example, currently I get 2 events from my  
> OS for a mouse-click, a mouse-down and a mouse-up, which are  
> translated into squeak mouse-events with the corresponding  
> button-flag set and cleared, respectively.  Is this correct? 

Yes. But remember that the button state includes more than just the button
pressed / released and it is expected that Squeak gets the full set of
"current" buttons. If you know that your system will report a single button
release at a time, then you may cache the last button state. If not you'll
have to query for it or to figure it out from the event you get.

> Is anything else expected, maybe some-sort of timed "MouseStillDown"  
> event?

No. You report changes, not current state ala "yes, the mouse is still down,
it's still pressed, yeah it still didn't go up, no it's still down, yeah,
really, it is down,
oh-why-don't-you-just-believe-me-the-mouse-IS-still-down" events. As long as
the VM doesn't miss any events (which is the entire point of this exercise)
Squeak is smart enough to do the rest.

HTH,

  - Andreas





More information about the Squeak-dev mailing list