author | Claus Gittinger <cg@exept.de> |
Mon, 14 Feb 2011 18:16:36 +0100 | |
branch | initialV |
changeset 9777 | 82d9e1236f1f |
parent 8583 | 1ba96eea53a8 |
child 12123 | 4bde08cebd48 |
child 14148 | 5e6a841c980f |
permissions | -rw-r--r-- |
52 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2805 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
6520 | 14 |
ApplicationModel subclass:#EventMonitor |
15 |
instanceVariableNames:'outputSelector' |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
16 |
classVariableNames:'' |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
17 |
poolDictionaries:'' |
1053 | 18 |
category:'Monitors-ST/X' |
19 | 19 |
! |
20 |
||
6520 | 21 |
View subclass:#EventMonitorView |
7354 | 22 |
instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents |
23 |
showTimestamp' |
|
6520 | 24 |
classVariableNames:'' |
25 |
poolDictionaries:'' |
|
26 |
privateIn:EventMonitor |
|
27 |
! |
|
28 |
||
1021 | 29 |
!EventMonitor class methodsFor:'documentation'! |
52 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
34 |
All Rights Reserved |
|
19 | 35 |
|
52 | 36 |
This software is furnished under a license and may be used |
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
like xev - show events. |
|
6520 | 48 |
|
52 | 49 |
You can use this to check your keyboard mappings, for example. |
50 |
start with: |
|
6520 | 51 |
EventMonitor open |
52 |
and watch the output on the xterm/console. |
|
52 | 53 |
" |
54 |
! ! |
|
19 | 55 |
|
1021 | 56 |
!EventMonitor class methodsFor:'defaults'! |
19 | 57 |
|
58 |
defaultExtent |
|
59 |
^ 200 @ 200 |
|
60 |
! |
|
61 |
||
62 |
defaultLabel |
|
63 |
^ 'Event Monitor' |
|
64 |
! ! |
|
65 |
||
6520 | 66 |
!EventMonitor class methodsFor:'interface specs'! |
67 |
||
68 |
windowSpec |
|
69 |
"This resource specification was automatically generated |
|
70 |
by the UIPainter of ST/X." |
|
71 |
||
72 |
"Do not manually edit this!! If it is corrupted, |
|
73 |
the UIPainter may not be able to read the specification." |
|
74 |
||
75 |
" |
|
76 |
UIPainter new openOnClass:EventMonitor andSelector:#windowSpec |
|
77 |
EventMonitor new openInterface:#windowSpec |
|
78 |
EventMonitor open |
|
79 |
" |
|
80 |
||
81 |
<resource: #canvas> |
|
82 |
||
83 |
^ |
|
84 |
#(FullSpec |
|
85 |
name: windowSpec |
|
86 |
window: |
|
87 |
(WindowSpec |
|
88 |
label: 'EventMonitor' |
|
89 |
name: 'EventMonitor' |
|
8089 | 90 |
min: (Point 100 100) |
6520 | 91 |
bounds: (Rectangle 0 0 300 300) |
92 |
menu: mainMenu |
|
93 |
) |
|
94 |
component: |
|
95 |
(SpecCollection |
|
96 |
collection: ( |
|
97 |
(NonScrollableArbitraryComponentSpec |
|
98 |
name: 'eventMonitorView' |
|
99 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
100 |
component: EventMonitorView |
|
101 |
) |
|
102 |
) |
|
103 |
||
104 |
) |
|
105 |
) |
|
106 |
! ! |
|
107 |
||
108 |
!EventMonitor class methodsFor:'menu specs'! |
|
109 |
||
110 |
mainMenu |
|
111 |
"This resource specification was automatically generated |
|
112 |
by the MenuEditor of ST/X." |
|
113 |
||
114 |
"Do not manually edit this!! If it is corrupted, |
|
115 |
the MenuEditor may not be able to read the specification." |
|
116 |
||
117 |
" |
|
118 |
MenuEditor new openOnClass:EventMonitor andSelector:#mainMenu |
|
119 |
(Menu new fromLiteralArrayEncoding:(EventMonitor mainMenu)) startUp |
|
120 |
" |
|
121 |
||
122 |
<resource: #menu> |
|
123 |
||
124 |
^ |
|
125 |
#(Menu |
|
126 |
( |
|
127 |
(MenuItem |
|
128 |
label: 'File' |
|
129 |
translateLabel: true |
|
130 |
submenu: |
|
131 |
(Menu |
|
132 |
( |
|
133 |
(MenuItem |
|
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
134 |
label: 'Open Modal Box' |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
135 |
itemValue: openModalBox |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
136 |
translateLabel: true |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
137 |
) |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
138 |
(MenuItem |
6520 | 139 |
label: 'Exit' |
140 |
itemValue: closeRequest |
|
141 |
translateLabel: true |
|
142 |
) |
|
143 |
) |
|
144 |
nil |
|
145 |
nil |
|
146 |
) |
|
147 |
) |
|
148 |
(MenuItem |
|
6582 | 149 |
label: 'Filter' |
150 |
translateLabel: true |
|
151 |
submenu: |
|
152 |
(Menu |
|
153 |
( |
|
154 |
(MenuItem |
|
7353 | 155 |
label: 'Show ButtonMotion Events' |
6582 | 156 |
itemValue: showButtonMotion: |
157 |
translateLabel: true |
|
158 |
indication: showButtonMotion |
|
159 |
) |
|
7353 | 160 |
(MenuItem |
161 |
label: 'Show Focus Events' |
|
162 |
itemValue: showFocusEvents: |
|
163 |
translateLabel: true |
|
164 |
indication: showFocusEvents |
|
165 |
) |
|
6582 | 166 |
) |
167 |
nil |
|
168 |
nil |
|
169 |
) |
|
170 |
) |
|
171 |
(MenuItem |
|
6520 | 172 |
label: 'Output' |
173 |
translateLabel: true |
|
174 |
submenu: |
|
175 |
(Menu |
|
176 |
( |
|
177 |
(MenuItem |
|
178 |
label: 'Stdout' |
|
179 |
translateLabel: true |
|
180 |
choice: outputSelector |
|
181 |
choiceValue: stdout |
|
182 |
) |
|
183 |
(MenuItem |
|
184 |
label: 'Transcript' |
|
185 |
translateLabel: true |
|
186 |
choice: outputSelector |
|
187 |
choiceValue: transcript |
|
188 |
) |
|
7354 | 189 |
(MenuItem |
190 |
label: '-' |
|
191 |
) |
|
192 |
(MenuItem |
|
193 |
label: 'Show Timestamp' |
|
194 |
itemValue: showTimestamp: |
|
195 |
translateLabel: true |
|
196 |
indication: showTimestamp |
|
197 |
) |
|
6520 | 198 |
) |
199 |
nil |
|
200 |
nil |
|
201 |
) |
|
202 |
) |
|
203 |
(MenuItem |
|
204 |
label: 'Help' |
|
205 |
translateLabel: true |
|
206 |
startGroup: right |
|
207 |
submenu: |
|
208 |
(Menu |
|
209 |
( |
|
210 |
(MenuItem |
|
211 |
label: 'Documentation' |
|
212 |
itemValue: openDocumentation |
|
213 |
translateLabel: true |
|
214 |
) |
|
215 |
(MenuItem |
|
216 |
label: '-' |
|
217 |
) |
|
218 |
(MenuItem |
|
219 |
label: 'About this Application' |
|
220 |
itemValue: openAboutThisApplication |
|
221 |
translateLabel: true |
|
222 |
) |
|
223 |
) |
|
224 |
nil |
|
225 |
nil |
|
226 |
) |
|
227 |
) |
|
228 |
) |
|
229 |
nil |
|
230 |
nil |
|
231 |
) |
|
232 |
! ! |
|
233 |
||
234 |
!EventMonitor methodsFor:'aspects'! |
|
235 |
||
6582 | 236 |
eventMonitorView |
237 |
^ (self builder componentAt:#eventMonitorView) |
|
238 |
! |
|
239 |
||
6520 | 240 |
outputSelector |
241 |
outputSelector isNil ifTrue:[ |
|
6759
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
242 |
outputSelector := #transcript asValue. |
6520 | 243 |
outputSelector onChangeEvaluate:[ self outputSelectorChanged ]. |
244 |
]. |
|
245 |
^ outputSelector |
|
246 |
! |
|
247 |
||
248 |
outputSelectorChanged |
|
249 |
|stream| |
|
250 |
||
251 |
stream := self outputSelector value == #transcript ifTrue:[Transcript] ifFalse:[Stdout]. |
|
6582 | 252 |
self eventMonitorView outputStream:stream. |
253 |
! |
|
254 |
||
6759
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
255 |
postBuildWith:aBuilder |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
256 |
super postBuildWith:aBuilder. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
257 |
self outputSelectorChanged. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
258 |
! |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
259 |
|
6582 | 260 |
showButtonMotion |
261 |
^ self eventMonitorView showButtonMotion |
|
262 |
! |
|
263 |
||
264 |
showButtonMotion:aBoolean |
|
265 |
^ self eventMonitorView showButtonMotion:aBoolean |
|
7353 | 266 |
! |
267 |
||
268 |
showFocusEvents |
|
269 |
^ self eventMonitorView showFocusEvents |
|
270 |
||
271 |
"Created: / 04-10-2006 / 13:05:16 / cg" |
|
272 |
! |
|
273 |
||
274 |
showFocusEvents:aBoolean |
|
275 |
^ self eventMonitorView showFocusEvents:aBoolean |
|
276 |
||
277 |
"Created: / 04-10-2006 / 13:05:19 / cg" |
|
7354 | 278 |
! |
279 |
||
280 |
showTimestamp |
|
281 |
^ self eventMonitorView showTimestamp |
|
282 |
||
283 |
"Created: / 04-10-2006 / 13:14:49 / cg" |
|
284 |
! |
|
285 |
||
286 |
showTimestamp:aBoolean |
|
287 |
^ self eventMonitorView showTimestamp:aBoolean |
|
288 |
||
289 |
"Created: / 04-10-2006 / 13:14:53 / cg" |
|
6520 | 290 |
! ! |
291 |
||
292 |
!EventMonitor methodsFor:'menu actions'! |
|
293 |
||
294 |
openAboutThisApplication |
|
295 |
"This method was generated by the Browser. |
|
296 |
It will be invoked when the menu-item 'help-about' is selected." |
|
297 |
||
298 |
"/ could open a customized aboutBox here ... |
|
299 |
super openAboutThisApplication |
|
300 |
! |
|
301 |
||
302 |
openDocumentation |
|
303 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#EVENTMONITOR'. |
|
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
304 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
305 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
306 |
openModalBox |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
307 |
Dialog information:'Modal Box' |
6520 | 308 |
! ! |
309 |
||
310 |
!EventMonitor::EventMonitorView class methodsFor:'defaults'! |
|
311 |
||
312 |
defaultExtent |
|
313 |
^ 200 @ 200 |
|
314 |
! |
|
315 |
||
316 |
defaultLabel |
|
317 |
^ 'Event Monitor' |
|
318 |
! ! |
|
319 |
||
320 |
!EventMonitor::EventMonitorView class methodsFor:'documentation'! |
|
321 |
||
322 |
documentation |
|
323 |
" |
|
324 |
like xev - show events. |
|
325 |
You can use this to check your keyboard mappings, for example. |
|
326 |
start with: |
|
327 |
EventMonitorView open |
|
328 |
and watch the output on xterm. |
|
329 |
" |
|
330 |
! ! |
|
331 |
||
332 |
!EventMonitor::EventMonitorView class methodsFor:'startup'! |
|
1822 | 333 |
|
334 |
isVisualStartable |
|
335 |
^ true |
|
336 |
||
337 |
"Created: / 10.8.1998 / 16:03:13 / cg" |
|
338 |
! ! |
|
339 |
||
6520 | 340 |
!EventMonitor::EventMonitorView methodsFor:'accessing'! |
341 |
||
7353 | 342 |
outputStream:aStream |
343 |
outputStream := aStream. |
|
6520 | 344 |
|
345 |
labelHolder value:nil. |
|
346 |
outputStream == Stdout ifTrue:[ |
|
347 |
labelHolder value: 'See event trace\on the standard output' withCRs. |
|
348 |
]. |
|
349 |
outputStream == Transcript ifTrue:[ |
|
350 |
labelHolder value: 'See event trace\on the Transcript' withCRs. |
|
351 |
]. |
|
6582 | 352 |
self invalidate. |
7353 | 353 |
|
354 |
"Modified: / 04-10-2006 / 13:04:16 / cg" |
|
6582 | 355 |
! |
356 |
||
357 |
showButtonMotion |
|
7353 | 358 |
^ showButtonMotion ? false |
359 |
||
360 |
"Modified: / 04-10-2006 / 13:03:31 / cg" |
|
361 |
! |
|
362 |
||
363 |
showButtonMotion:aBoolean |
|
364 |
showButtonMotion := aBoolean. |
|
365 |
||
366 |
"Modified: / 04-10-2006 / 13:04:08 / cg" |
|
6582 | 367 |
! |
368 |
||
7353 | 369 |
showFocusEvents |
370 |
^ showFocusEvents ? true |
|
371 |
||
372 |
"Created: / 04-10-2006 / 13:03:48 / cg" |
|
373 |
! |
|
374 |
||
375 |
showFocusEvents:aBoolean |
|
376 |
showFocusEvents := aBoolean. |
|
377 |
||
378 |
"Created: / 04-10-2006 / 13:04:04 / cg" |
|
7354 | 379 |
! |
380 |
||
381 |
showTimestamp |
|
382 |
^ showTimestamp ? false |
|
383 |
||
384 |
"Created: / 04-10-2006 / 13:06:57 / cg" |
|
385 |
! |
|
386 |
||
387 |
showTimestamp:aBoolean |
|
388 |
showTimestamp := aBoolean. |
|
389 |
||
390 |
"Created: / 04-10-2006 / 13:07:02 / cg" |
|
6520 | 391 |
! ! |
392 |
||
393 |
!EventMonitor::EventMonitorView methodsFor:'drawing'! |
|
394 |
||
395 |
redraw |
|
396 |
|y p lines| |
|
397 |
||
398 |
self clear. |
|
399 |
lines := labelHolder value asCollectionOfLines. |
|
400 |
||
401 |
y := (self height - ((font heightOf:'A') * lines size)) // 2. |
|
402 |
lines do:[:eachLine | |
|
403 |
p := (self center x - ((font widthOf:eachLine) // 2)) @ y. |
|
404 |
self displayString:eachLine value x:(p x) y:(p y). |
|
405 |
y := y + (font heightOf:eachLine). |
|
406 |
] |
|
7354 | 407 |
! |
408 |
||
409 |
showEventTime |
|
410 |
self showTimestamp ifTrue:[ |
|
411 |
Transcript show:(Timestamp now); show:' '. |
|
412 |
] |
|
413 |
||
414 |
"Created: / 04-10-2006 / 13:08:27 / cg" |
|
6520 | 415 |
! ! |
416 |
||
417 |
!EventMonitor::EventMonitorView methodsFor:'events'! |
|
19 | 418 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
419 |
buttonMotion:state x:x y:y |
6582 | 420 |
self showButtonMotion ifFalse:[^ self]. |
421 |
||
7354 | 422 |
self showEventTime. |
6520 | 423 |
outputStream nextPutAll:'buttonMotion x:'. |
424 |
x printOn:outputStream. |
|
425 |
outputStream nextPutAll:' y:'. |
|
426 |
y printOn:outputStream. |
|
427 |
outputStream nextPutAll:' state:'. |
|
428 |
state printOn:outputStream. |
|
429 |
outputStream cr. |
|
1117 | 430 |
|
7354 | 431 |
"Modified: / 04-10-2006 / 13:07:53 / cg" |
19 | 432 |
! |
433 |
||
2159 | 434 |
buttonMultiPress:button x:x y:y |
7354 | 435 |
self showEventTime. |
436 |
||
6520 | 437 |
outputStream nextPutAll:'buttonMultiPress x:'. |
438 |
x printOn:outputStream. |
|
439 |
outputStream nextPutAll:' y:'. |
|
440 |
y printOn:outputStream. |
|
441 |
outputStream nextPutAll:' button:'. |
|
442 |
button printOn:outputStream. |
|
443 |
outputStream cr. |
|
2159 | 444 |
|
7354 | 445 |
"Created: / 19-05-1999 / 09:40:40 / cg" |
446 |
"Modified: / 04-10-2006 / 13:08:36 / cg" |
|
2159 | 447 |
! |
448 |
||
19 | 449 |
buttonPress:button x:x y:y |
7354 | 450 |
self showEventTime. |
451 |
||
6520 | 452 |
outputStream nextPutAll:'buttonPress x:'. |
453 |
x printOn:outputStream. |
|
454 |
outputStream nextPutAll:' y:'. |
|
455 |
y printOn:outputStream. |
|
456 |
outputStream nextPutAll:' button:'. |
|
457 |
button printOn:outputStream. |
|
458 |
outputStream cr. |
|
459 |
outputStream flush. |
|
1117 | 460 |
|
7354 | 461 |
"Modified: / 04-10-2006 / 13:08:43 / cg" |
19 | 462 |
! |
463 |
||
464 |
buttonRelease:button x:x y:y |
|
7354 | 465 |
self showEventTime. |
466 |
||
6520 | 467 |
outputStream nextPutAll:'buttonRelease x:'. |
468 |
x printOn:outputStream. |
|
469 |
outputStream nextPutAll:' y:'. |
|
470 |
y printOn:outputStream. |
|
471 |
outputStream nextPutAll:' button:'. |
|
472 |
button printOn:outputStream. |
|
473 |
outputStream cr. |
|
1117 | 474 |
|
7354 | 475 |
"Modified: / 04-10-2006 / 13:08:46 / cg" |
19 | 476 |
! |
477 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
478 |
configureX:x y:y width:newWidth height:newHeight |
7354 | 479 |
self showEventTime. |
480 |
||
6520 | 481 |
outputStream nextPutAll:'configure x:'. |
482 |
x printOn:outputStream. |
|
483 |
outputStream nextPutAll:' y:'. |
|
484 |
y printOn:outputStream. |
|
485 |
outputStream nextPutAll:' width:'. |
|
486 |
newWidth printOn:outputStream. |
|
487 |
outputStream nextPutAll:' height:'. |
|
488 |
newHeight printOn:outputStream. |
|
489 |
outputStream nextPutAll:' button:'. |
|
490 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
491 |
|
6520 | 492 |
super configureX:x y:y width:newWidth height:newHeight. |
493 |
||
494 |
self invalidate. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
495 |
|
7354 | 496 |
"Modified: / 04-10-2006 / 13:08:49 / cg" |
1117 | 497 |
! |
498 |
||
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
499 |
coveredBy:coveringView |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
500 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
501 |
self showEventTime. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
502 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
503 |
outputStream nextPutAll:'coveredBy: '. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
504 |
coveringView printOn:outputStream. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
505 |
outputStream cr. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
506 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
507 |
|
7320 | 508 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
509 |
event isButtonMotionEvent ifTrue:[ |
|
510 |
self showButtonMotion ifFalse:[^ self]. |
|
511 |
]. |
|
512 |
||
513 |
"/ Timestamp now printOn:outputStream. |
|
514 |
"/ outputStream nextPutAll:' '. |
|
515 |
||
516 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate. |
|
517 |
||
518 |
"Created: / 20-09-2006 / 10:29:38 / cg" |
|
519 |
! |
|
520 |
||
1117 | 521 |
dropMessage:dropType data:dropData |
7354 | 522 |
self showEventTime. |
523 |
||
6520 | 524 |
outputStream nextPutAll:'drop '. |
525 |
dropType printOn:outputStream. |
|
526 |
outputStream nextPutAll:' data:'. |
|
527 |
dropData printOn:outputStream. |
|
528 |
outputStream cr. |
|
1117 | 529 |
|
7354 | 530 |
"Modified: / 04-10-2006 / 13:09:13 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
531 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
532 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
533 |
focusIn |
7353 | 534 |
self showFocusEvents ifFalse:[^ self]. |
535 |
||
7354 | 536 |
self showEventTime. |
537 |
||
6520 | 538 |
outputStream nextPutLine:'focusIn '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
539 |
|
7353 | 540 |
"Created: / 07-03-1996 / 15:06:18 / cg" |
7354 | 541 |
"Modified: / 04-10-2006 / 13:09:17 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
542 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
543 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
544 |
focusOut |
7353 | 545 |
self showFocusEvents ifFalse:[^ self]. |
546 |
||
7354 | 547 |
self showEventTime. |
548 |
||
6520 | 549 |
outputStream nextPutLine:'focusOut '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
550 |
|
7353 | 551 |
"Created: / 07-03-1996 / 15:06:21 / cg" |
7354 | 552 |
"Modified: / 04-10-2006 / 13:09:20 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
553 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
554 |
|
2159 | 555 |
hasKeyboardFocus:aBoolen |
7353 | 556 |
self showFocusEvents ifFalse:[^ self]. |
557 |
||
7354 | 558 |
self showEventTime. |
559 |
||
6520 | 560 |
outputStream nextPutAll:'hasKeyboardFocus:'. |
561 |
aBoolen printOn:outputStream. |
|
562 |
outputStream cr. |
|
2159 | 563 |
|
7354 | 564 |
"Modified: / 04-10-2006 / 13:09:23 / cg" |
2159 | 565 |
! |
566 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
567 |
keyPress:key x:x y:y |
6344 | 568 |
|s rawKey untranslatedKey| |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
569 |
|
7354 | 570 |
self showEventTime. |
571 |
||
2805 | 572 |
s := 'KeyPress x:' , x printString , ' y:' , y printString. |
6520 | 573 |
s printOn:outputStream. |
6344 | 574 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
575 |
(key isMemberOf:Character) ifTrue:[ |
6582 | 576 |
s := ' character key:' , key storeString |
2805 | 577 |
, ' (' , key asciiValue printString , ')'. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
578 |
] ifFalse:[ |
2805 | 579 |
s := ' symbolic key:' , key storeString. |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
580 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
581 |
untranslatedKey ~~ key ifTrue:[ |
6582 | 582 |
s := s , ' untranslated key:' , untranslatedKey storeString |
2805 | 583 |
]. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
584 |
]. |
6344 | 585 |
rawKey := (WindowGroup lastEventQuerySignal query) rawKey. |
6582 | 586 |
s := s , ' rawKey:' , rawKey storeString. |
6344 | 587 |
|
6520 | 588 |
s printOn:outputStream. |
7354 | 589 |
|
590 |
key isCharacter ifTrue:[ |
|
591 |
outputStream nextPutAll:' '''. |
|
592 |
key asString printOn:outputStream. |
|
593 |
outputStream nextPutAll:''''. |
|
594 |
]. |
|
6520 | 595 |
outputStream cr. |
7354 | 596 |
|
597 |
"Modified: / 04-10-2006 / 13:12:07 / cg" |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
598 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
599 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
600 |
keyRelease:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
601 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
602 |
|
7354 | 603 |
self showEventTime. |
604 |
||
6520 | 605 |
'KeyRelease x:' printOn:outputStream. |
606 |
x printOn:outputStream. |
|
607 |
' y:' printOn:outputStream. |
|
608 |
y printOn:outputStream. |
|
609 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
610 |
(key isMemberOf:Character) ifTrue:[ |
6187 | 611 |
key codePoint <= 16rFF ifTrue:[ |
6520 | 612 |
' character key:' printOn:outputStream. |
6582 | 613 |
key storeString printOn:outputStream. |
6187 | 614 |
] ifFalse:[ |
6520 | 615 |
' unicode character utf8:' printOn:outputStream. |
616 |
key asString utf8Encoded asByteArray hexPrintOn:outputStream. |
|
6187 | 617 |
]. |
6520 | 618 |
' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
619 |
] ifFalse:[ |
6582 | 620 |
' symbolic key:' print. key storeString printOn:outputStream. |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
621 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
622 |
untranslatedKey ~~ key ifTrue:[ |
6582 | 623 |
' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
624 |
] |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
625 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
626 |
|
6520 | 627 |
outputStream cr |
7354 | 628 |
|
629 |
"Modified: / 04-10-2006 / 13:09:27 / cg" |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
630 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
631 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
632 |
mapped |
7354 | 633 |
self showEventTime. |
634 |
||
6520 | 635 |
outputStream nextPutLine:'mapped '. |
636 |
||
1977 | 637 |
super mapped. |
1117 | 638 |
|
7354 | 639 |
"Modified: / 04-10-2006 / 13:09:31 / cg" |
45 | 640 |
! |
641 |
||
52 | 642 |
pointerEnter:state x:x y:y |
7354 | 643 |
self showEventTime. |
644 |
||
6520 | 645 |
outputStream nextPutAll:'pointerEnter x:'. |
646 |
x printOn:outputStream. |
|
647 |
outputStream nextPutAll:' y:'. |
|
648 |
y printOn:outputStream. |
|
649 |
outputStream nextPutAll:' state:'. |
|
650 |
state printOn:outputStream. |
|
651 |
outputStream cr. |
|
1117 | 652 |
|
7354 | 653 |
"Modified: / 04-10-2006 / 13:09:34 / cg" |
52 | 654 |
! |
655 |
||
656 |
pointerLeave:state |
|
7354 | 657 |
self showEventTime. |
658 |
||
6520 | 659 |
outputStream nextPutAll:'pointerLeave state:'. |
660 |
state storeString printOn:outputStream. |
|
661 |
outputStream cr. |
|
1117 | 662 |
|
7354 | 663 |
"Modified: / 04-10-2006 / 13:09:36 / cg" |
52 | 664 |
! |
665 |
||
6582 | 666 |
sizeChanged:how |
8089 | 667 |
outputStream nextPutAll:'sizeChanged how:'. |
668 |
how printOn:outputStream. |
|
669 |
outputStream cr. |
|
670 |
||
6582 | 671 |
super sizeChanged:how. |
672 |
self invalidate |
|
7354 | 673 |
|
674 |
"Modified: / 04-10-2006 / 13:17:46 / cg" |
|
6582 | 675 |
! |
676 |
||
45 | 677 |
unmapped |
7354 | 678 |
self showEventTime. |
679 |
||
6520 | 680 |
outputStream nextPutLine:'unmapped '. |
681 |
||
1977 | 682 |
super unmapped. |
1117 | 683 |
|
7354 | 684 |
"Modified: / 04-10-2006 / 13:09:41 / cg" |
45 | 685 |
! |
686 |
||
687 |
visibilityChange:how |
|
7354 | 688 |
self showEventTime. |
689 |
||
6520 | 690 |
outputStream nextPutAll:'visibilityChange:'. |
691 |
how storeString printOn:outputStream. |
|
692 |
outputStream cr. |
|
693 |
||
1977 | 694 |
super visibilityChange:how |
1117 | 695 |
|
7354 | 696 |
"Modified: / 04-10-2006 / 13:09:43 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
697 |
! ! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
698 |
|
6520 | 699 |
!EventMonitor::EventMonitorView methodsFor:'initialization'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
700 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
701 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
702 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
703 |
|
6520 | 704 |
labelHolder := '' asValue. |
705 |
self outputStream:Stdout. |
|
19 | 706 |
! ! |
707 |
||
6520 | 708 |
!EventMonitor::EventMonitorView methodsFor:'realization'! |
19 | 709 |
|
710 |
initEvents |
|
711 |
self enableMotionEvents. |
|
45 | 712 |
self enableKeyReleaseEvents. |
52 | 713 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
714 |
self enableFocusEvents. |
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
715 |
self enableEvent:#visibilityChange. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
716 |
"/ self enableEvent:#structureNotify. |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
717 |
"/ self enableEvent:#substructureNotify. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
718 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
719 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 720 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
721 |
|
1021 | 722 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
723 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
724 |
version |
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
725 |
^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.30 2009-03-20 17:44:15 stefan Exp $' |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
726 |
! ! |