Friday, December 10, 2004

TPointer & Event Processing...

I have been learning about the Croquet event processing loop, in my attempt to get a pickable overhead view.

1) It all starts with Squeak and Morphic. The TeapotMorph is just another morph as far as Squeak is concerned. By default it registers itself for the full compliment of mouse and keyboard events.

2) I haven't fully groked Squeaks focus handling. Sometimes it uses mouse-over, sometimes it is click-to-focus. Unfortunately, click-to-focus does not seem to work on the TeaportMorph and keystrokes continue to go to the last selected morph. You can force it by putting this in a mouse event:
ActiveHand keyboardFocus: teaportMorph.

3) The TeapotMorph's default behavior is to route all it's events to it's activeCamera, which is a TUserCamera. The interesting call for me is camera >> pointerXY: evt position. This takes the viewpoint coordinates of the mouse and updates the TPointer that is attached to the userCamera.