Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.35.mcz ==================== Summary ==================== Name: VMMakerUI-eem.35 Author: eem Time: 2 January 2021, 1:22:27.912176 pm UUID: c7b0db6a-9e59-4a22-a650-35f2efbdb0ad Ancestors: VMMakerUI-eem.34 Fix event delivery for 32-bit simulations. The event timestamp must be truncated. Pull queueForwardedEvent: into this package. =============== Diff against VMMakerUI-eem.34 =============== Item was changed: ----- Method: SimulatorEventTransformer>>degenerateKeyboardEvent:for: (in category 'event transformation') ----- degenerateKeyboardEvent: aMorphicEvent for: aClient "Convert the keyboard event into a low-level event for the VM simulator (aClient). See HandMorph>>generateKeyboardEvent and EventSensor class comment" aClient queueForwardedEvent: { EventTypeKeyboard. + aClient eventTimestamp. - aClient ioUTCMicroseconds // 1000. aMorphicEvent keyValue. "<--this is wrong. See nextCharFrom:firstEvt: for what needs to be undone. hooo boy" aMorphicEvent type caseOf: { [#keyDown] -> [EventKeyDown]. [#keyUp] -> [EventKeyUp]. [#keystroke] -> [EventKeyChar] }. modifiers. aMorphicEvent keyValue. 0. self windowIndex }! Item was changed: ----- Method: SimulatorEventTransformer>>degenerateMouseEvent:for: (in category 'event transformation') ----- degenerateMouseEvent: aMorphicEvent for: aClient "Convert the mouse event into low-level events for the VM simulator (aClient). Filter-out mouse moves, and generate a fake mouse move before each button press. See HandMorph>>generateMouseEvent" | translated newMouseEvent | modifiers := aMorphicEvent buttons >> 3. "Sad, but modifiers come in on mouse move events..." "filter-out mouse moves unless buttons are pressed, so simulation doesn't get window leave events when we leave its window" aMorphicEvent type == #mouseMove ifTrue: [(aClient displayView bounds containsPoint: aMorphicEvent position) ifFalse: [^self]]. translated := aMorphicEvent position - aClient displayView bounds origin. newMouseEvent := { EventTypeMouse. + aClient eventTimestamp. - aClient ioUTCMicroseconds // 1000. translated x. translated y. aMorphicEvent buttons bitAnd: 7. "thanks Ron T." modifiers. "Thanks dtl" aMorphicEvent class == MouseButtonEvent ifTrue: [aMorphicEvent nClicks] ifFalse: [0]. self windowIndex }. aClient eventQueue withinPeekLastDo: [:event| "Squash mouse move events..." (#[1 5 6 7 8] allSatisfy: [:index| (event at: index) = (newMouseEvent at: index)]) ifTrue: [^event replaceFrom: 2 to: 4 with: newMouseEvent startingAt: 2]]. aClient queueForwardedEvent: newMouseEvent! Item was added: + ----- Method: StackInterpreter>>eventTimestamp (in category '*VMMakerUI-user interface') ----- + eventTimestamp + <doNotGenerate> + ^BytesPerWord = 4 + ifTrue: [self ioUTCMicroseconds // 1000 bitAnd: MillisecondClockMask] + ifFalse: [self ioUTCMicroseconds // 1000]! Item was added: + ----- Method: StackInterpreter>>queueForwardedEvent: (in category '*VMMakerUI-user interface') ----- + queueForwardedEvent: event + "SimulatorMorphicModel browse" + <doNotGenerate> + self eventQueue nextPut: event. + self inputSemaphoreIndex + ifNotNil: + [:isi| self signalSemaphoreWithIndex: isi] + ifNil: + [nextPollUsecs := self ioUTCMicroseconds. + self forceInterruptCheck]! |
Free forum by Nabble | Edit this page |