Here I trace a mouse event that is sent into the 3d space. This is based on the 3.8 Cobalt. The way this works on 4.1 Cobalt is a little simpler. ---- Morphic Event Loop (event processing phase) ---- - as part of the event loop (WorldState >> doOneCycleNowFor:) - Morphic processes events (HandMorph >> processEvents) - It reads the event from the VM (EventSensor >> nextEvent) - The event dispatcher decides the event is inside CobaltBrowser and asks it to handle the event (CroquetParticipantWithMenu >> handleEvent:) - Cobalt forsakes normal event handling and simply dumps the raw event into the Tweak event queue (CroquetParticipantWithMenu >> handleEvent:) ---- Morphic Event Loop (stepping phase) ---- - CroquetParticipantWithMenu >> step - CroquetParticipantWithMenu >> runTweakCycle - CroquetMenuWorld >> runCroquetCycle - Start the Tweak script CHandPlayer >> processEventsFrom: to read the events from the world queue - Run the scheduler to run the script processes ---- Tweak Script: CHandPlayer >> processEventsFrom: ---- - Start the script CHandPlayer >> dispatchEvent: with the event ---- Tweak Script: CHandPlayer >> dispatchEvent: ---- - the hand signals #mouseDown; nobody is listening (self signal: evt type with: evt) - the hand sets lastEvent - the hand signals #updateMouseOver, which will trigger CHandPlayer >> onUpdateMouseOver later to see if the cursor needs changing - The hand dispatches the event (CHandPlayer >> sendMouseEvent) - The dispatcher decides the world should handle it (CPrimitiveCostume >> handleMouseDown:) - stuff