[Pkg] The Trunk: Kernel-dtl.733.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Feb 7 02:03:05 UTC 2013


David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.733.mcz

==================== Summary ====================

Name: Kernel-dtl.733
Author: dtl
Time: 6 February 2013, 9:02:02.046 pm
UUID: b74ab5eb-4f9f-4f1a-bf6d-90f8f60fb3c4
Ancestors: Kernel-eem.732

Remove EventSensor>>wait2ms

Use of EventSensor>>wait2ms in sensor direct access to mouse and keyboard causes slow and incorrect keyboard handling in MVC. In newer Squeak images (3.9 and later), removing the delay restores normal MVC keyboard input.

This change removes the wait2ms delay entirely. If the problem described in http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116185.html should reappear, a different solution will be required.

Notes:

In Squeak trunk, the wait2ms delay is invoked only when in MVC. However, Scratch (and possibly other applications) makes use of direct sensor access from Morphic (arguably this is an error in Scratch, but the usage exists nonetheless).

Background:

Recent thread in which Stéphane Rollandin identified the source of the problem:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-February/168526.html

Rationale for introducing the delay in earlier versions of Squeak:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-May/116185.html

=============== Diff against Kernel-eem.732 ===============

Item was changed:
  ----- Method: EventSensor>>peekButtons (in category 'accessing') -----
  peekButtons
- 	self wait2ms.
  	self fetchMoreEvents.
  	^mouseButtons!

Item was changed:
  ----- Method: EventSensor>>peekPosition (in category 'accessing') -----
  peekPosition
- 	self wait2ms.
  	self fetchMoreEvents.
  	^mousePosition!

Item was changed:
  ----- Method: EventSensor>>primKbdNext (in category 'private') -----
  primKbdNext
  	"Allows for use of old Sensor protocol to get at the keyboard,
  	as when running kbdTest or the InterpreterSimulator in Morphic"
  	| evtBuf |
- 	self wait2ms.
  	self fetchMoreEvents.
  	keyboardBuffer isEmpty ifFalse:[^ keyboardBuffer next].
  	eventQueue ifNotNil:
  		[evtBuf := eventQueue nextOrNilSuchThat: [:buf | self isKbdEvent: buf].
  		self flushNonKbdEvents].
  	^ evtBuf ifNotNil: [evtBuf at: 3]
  !

Item was changed:
  ----- Method: EventSensor>>primKbdPeek (in category 'private') -----
  primKbdPeek
  	"Allows for use of old Sensor protocol to get at the keyboard,
  	as when running kbdTest or the InterpreterSimulator in Morphic"
  	| char |
- 	self wait2ms.
  	self fetchMoreEvents.
  	keyboardBuffer isEmpty ifFalse: [^ keyboardBuffer peek].
  	char := nil.
  	eventQueue ifNotNil:
  		[eventQueue nextOrNilSuchThat:  "NOTE: must not return out of this block, so loop to end"
  			[:buf | (self isKbdEvent: buf) ifTrue: [char ifNil: [char := buf at: 3]].
  			false  "NOTE: block value must be false so Queue won't advance"]].
  	^ char!

Item was changed:
  ----- Method: EventSensor>>primMouseButtons (in category 'private') -----
  primMouseButtons
- 	self wait2ms.
  	self fetchMoreEvents.
  	self flushNonKbdEvents.
  	^ mouseButtons!

Item was changed:
  ----- Method: EventSensor>>primMousePt (in category 'private') -----
  primMousePt
- 	self wait2ms.
  	self fetchMoreEvents.
  	self flushNonKbdEvents.
  	^ mousePosition!

Item was removed:
- ----- Method: EventSensor>>wait2ms (in category 'private') -----
- wait2ms
- 	(Delay forMilliseconds: 2) wait.!



More information about the Packages mailing list