'From TeaSqueak3.2 of 19 September 2002 [latest update: #401] on 18 May 2003 at 6:28:38 pm'! "Change Set: EventSensorConstants Date: 18 May 2003 Author: Andreas Raab Rewrite EventSensorConstants as declarative pool." Smalltalk at: #EventSensorConstantsOBSOLETEPOOL put: EventSensorConstants. Smalltalk removeKey: #EventSensorConstants.! SharedPool subclass: #EventSensorConstants instanceVariableNames: '' classVariableNames: 'BlueButtonBit CommandKeyBit CtrlKeyBit EventKeyChar EventKeyDown EventKeyUp EventTypeDragDropFiles EventTypeKeyboard EventTypeMouse EventTypeNone OptionKeyBit RedButtonBit ShiftKeyBit YellowButtonBit ' poolDictionaries: '' category: 'Kernel-Processes'! !EventSensor methodsFor: 'mouse' stamp: 'ar 5/18/2003 18:27'! createMouseEvent "create and return a new mouse event from the current mouse position; this is useful for restarting normal event queue processing after manual polling" | buttons modifiers pos mapped eventBuffer | eventBuffer _ Array new: 8. buttons _ self primMouseButtons. pos _ self primMousePt. modifiers _ buttons bitShift: -3. buttons _ buttons bitAnd: 7. mapped _ self mapButtons: buttons modifiers: modifiers. eventBuffer at: 1 put: EventTypeMouse; at: 2 put: Time millisecondClockValue; at: 3 put: pos x; at: 4 put: pos y; at: 5 put: mapped; at: 6 put: modifiers. ^ eventBuffer! ! !EventSensorConstants class methodsFor: 'pool initialization' stamp: 'ar 5/18/2003 18:26'! initialize "EventSensorConstants initialize" RedButtonBit := 4. BlueButtonBit := 2. YellowButtonBit := 1. ShiftKeyBit := 1. CtrlKeyBit := 2. OptionKeyBit := 4. CommandKeyBit := 8. "Types of events" EventTypeNone := 0. EventTypeMouse := 1. EventTypeKeyboard := 2. EventTypeDragDropFiles := 3. "Press codes for keyboard events" EventKeyChar := 0. EventKeyDown := 1. EventKeyUp := 2. ! ! EventSensorConstants initialize! !EventSensorConstants class reorganize! ('pool initialization' initialize) ! "Postscript: Rebind users of EventSensorConstants" Smalltalk allClassesDo:[:aClass| (aClass sharedPools includes: EventSensorConstantsOBSOLETEPOOL) ifTrue:[ Compiler evaluate: (aClass definition copyReplaceAll: 'OBSOLETEPOOL' with: ''). ]. ]. Smalltalk removeKey: #EventSensorConstantsOBSOLETEPOOL.!