I don't think there is any reason to convert to an OS array - HandMorph>>processEvents already knows the OS event array that was used to generate the squeak event. Making that accessible may be all you need from the front end.

Cheers,
Bob

On 1/23/14 4:43 AM, Henrik Johansen wrote:
 



On 22 Jan 2014, at 7:05 , Eliot Miranda <eliot.miranda@gmail.com> wrote:

So your challenge is to take the Morphic event, queue it inside StackInterpreterSimulator (e.g. in a new inst var eventQueue), and convert it to an OS event (an Array), so that it can for example implement ioGetNextEvent: as something like

StackInterpreterSimulator>>ioGetNextEvent: evtBuf

eventQueue isEmpty ifTrue:
[^self primitiveFail].

self convertMorphicEvent: eventQueue removeFirst into: evtBuf

As for the conversion into the OS array, searching for "Event Types” in sq.h will probably give a better introduction/faster understand as to the structure of said array than delving into the code doing array -> morphic event conversion in an image.
Make sure you get WindowEvent type 6 correct! :)

Cheers,
Henry