35 |
35 |
36 documentation |
36 documentation |
37 " |
37 " |
38 in contrast to a regular windowSensor, instances of SynchronousWindowSensor |
38 in contrast to a regular windowSensor, instances of SynchronousWindowSensor |
39 do NOT put events into a queue and do NOT wakeup any windowGroup process. |
39 do NOT put events into a queue and do NOT wakeup any windowGroup process. |
40 These are used for only one single situation: when a modal debugger |
40 Instead, the underlying view is notified synchronously (via a message send) |
41 (i.e. one that is debugging the scheduler or event-dispatcher) is open. |
41 about the event. |
|
42 |
|
43 These are used for only one single situation: |
|
44 when a modal debugger is open |
|
45 (i.e. one that is debugging the scheduler or event-dispatcher). |
42 This debuggers windowGroup is augmented with a synchronous Sensor, in order |
46 This debuggers windowGroup is augmented with a synchronous Sensor, in order |
43 to prevent the event handling code from suspending any process |
47 to prevent the event handling code from suspending any process |
44 (you cannot suspend the scheduler). |
48 (you cannot suspend the scheduler; you should not suspend the event dispatcher). |
|
49 |
45 This is pretty tricky and magic - you dont have to understand this. |
50 This is pretty tricky and magic - you dont have to understand this. |
46 (consider this system internal code) |
51 (consider this system internal code) |
47 " |
52 " |
48 ! ! |
53 ! ! |
49 |
54 |
192 |
197 |
193 keyPress:untranslatedKey x:x y:y view:aView |
198 keyPress:untranslatedKey x:x y:y view:aView |
194 "forward a key-press event for some view" |
199 "forward a key-press event for some view" |
195 |
200 |
196 |xlatedKey| |
201 |xlatedKey| |
|
202 |
|
203 self key:untranslatedKey state:true. |
197 |
204 |
198 xlatedKey := device translateKey:untranslatedKey. |
205 xlatedKey := device translateKey:untranslatedKey. |
199 xlatedKey notNil ifTrue:[ |
206 xlatedKey notNil ifTrue:[ |
200 WindowEvent |
207 WindowEvent |
201 sendEvent:#keyPress:x:y: |
208 sendEvent:#keyPress:x:y: |
202 arguments:(Array with:xlatedKey with:x with:y) |
209 arguments:(Array with:xlatedKey with:x with:y) |
203 view:aView |
210 view:aView |
204 ] |
211 ] |
205 |
212 |
206 "Created: 24.11.1995 / 19:17:23 / cg" |
213 "Created: 24.11.1995 / 19:17:23 / cg" |
207 "Modified: 24.11.1995 / 19:19:25 / cg" |
214 "Modified: 25.11.1995 / 10:21:26 / cg" |
208 ! |
215 ! |
209 |
216 |
210 keyRelease:untranslatedKey x:x y:y view:aView |
217 keyRelease:untranslatedKey x:x y:y view:aView |
211 "forward a key-release event for some view" |
218 "forward a key-release event for some view" |
212 |
219 |
213 |xlatedKey| |
220 |xlatedKey| |
|
221 |
|
222 self key:untranslatedKey state:false. |
214 |
223 |
215 xlatedKey := device translateKey:untranslatedKey. |
224 xlatedKey := device translateKey:untranslatedKey. |
216 xlatedKey notNil ifTrue:[ |
225 xlatedKey notNil ifTrue:[ |
217 WindowEvent |
226 WindowEvent |
218 sendEvent:#keyRelease:x:y: |
227 sendEvent:#keyRelease:x:y: |
219 arguments:(Array with:xlatedKey with:x with:y) |
228 arguments:(Array with:xlatedKey with:x with:y) |
220 view:aView |
229 view:aView |
221 ] |
230 ] |
222 |
231 |
223 "Created: 24.11.1995 / 19:17:50 / cg" |
232 "Created: 24.11.1995 / 19:17:50 / cg" |
224 "Modified: 24.11.1995 / 19:19:28 / cg" |
233 "Modified: 25.11.1995 / 10:21:37 / cg" |
225 ! |
234 ! |
226 |
235 |
227 mappedView:aView |
236 mappedView:aView |
228 "forward a mapped event for some view" |
237 "forward a mapped event for some view" |
229 |
238 |