But as far as I can see, that "if key <space> pressed?" cannot be event driven, because we don't want to start execution at that block if the space key is pressed, rather we want that to evaluate to true if the space key has been pressed recently ("recently" seems a problematic term to use here but that's another issue!).Here's the code I started throwing together to make this work -- see the bit following this line:type = EventTypeKeyboardInputEventSensor>>processEvent: evt"Process a single event. This method is run at high priority.The event record is:<type><timestamp><character code><updown><modifier keys>...where updown is:0 - keystroke1 - key down2 - key upNOTE: You must ensure that there is an instance variable keyPressed."| type updown |type := evt at: 1."Treat menu events first"type = EventTypeMenuifTrue: [self processMenuEvent: evt.^nil]."Tackle mouse events first"type = EventTypeMouseifTrue: ["Transmogrify the button state according to the platform's button map definition"evt at: 5 put: (ButtonDecodeTable at: (evt at: 5) + 1)."Map the mouse buttons depending on modifiers"evt at: 5 put: (self mapButtons: (evt at: 5) modifiers: (evt at: 6))."Update state for polling calls"mousePosition := (evt at: 3) @ (evt at: 4).modifiers := evt at: 6.mouseButtons := evt at: 5.^evt]."Finally keyboard"type = EventTypeKeyboardifTrue: ["Update state for polling calls"modifiers := evt at: 5.updown := evt at: 4.(updown = 2) ifTrue: [keyPressed := nil] ifFalse: [keyPressed := evt at: 3 ].^evt]."Handle all events other than Keyborad or Mouse."^evt.Then I use this:InputEventSensor>>keyPressed: asciiValue"Is this key being pressed?"self nextEvent.^keyPressed = asciiValueSo should I be doing this? Should I test out these changes and suggest a patch to Pharo? I'm happy that the answer might be "no", but what can I try instead?Thanks for your help.-Eric.--
Eric Clack
ericclack@googlemail.com
East Sussex, England.