author | Stefan Vogel <sv@exept.de> |
Thu, 20 Mar 2014 13:53:40 +0100 | |
changeset 14149 | e248bf1390a0 |
parent 14148 | 5e6a841c980f |
child 15566 | 184cea584be5 |
child 16250 | 74b7110c626e |
permissions | -rw-r--r-- |
52 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
14149 | 3 |
All Rights Reserved |
52 | 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 |
14149 | 15 |
instanceVariableNames:'outputSelector' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Monitors-ST/X' |
|
19 | 19 |
! |
20 |
||
6520 | 21 |
View subclass:#EventMonitorView |
14149 | 22 |
instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents |
23 |
showTimestamp' |
|
24 |
classVariableNames:'' |
|
25 |
poolDictionaries:'' |
|
26 |
privateIn:EventMonitor |
|
6520 | 27 |
! |
28 |
||
1021 | 29 |
!EventMonitor class methodsFor:'documentation'! |
52 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
14149 | 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. |
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
50 |
start with: |
14149 | 51 |
EventMonitor open |
6520 | 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 |
||
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
83 |
^ |
6520 | 84 |
#(FullSpec |
14149 | 85 |
name: windowSpec |
86 |
window: |
|
6520 | 87 |
(WindowSpec |
14149 | 88 |
label: 'EventMonitor' |
89 |
name: 'EventMonitor' |
|
90 |
min: (Point 100 100) |
|
91 |
bounds: (Rectangle 0 0 300 300) |
|
92 |
menu: mainMenu |
|
93 |
) |
|
94 |
component: |
|
6520 | 95 |
(SpecCollection |
14149 | 96 |
collection: ( |
97 |
(NonScrollableArbitraryComponentSpec |
|
98 |
name: 'eventMonitorView' |
|
99 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
100 |
component: EventMonitorView |
|
101 |
) |
|
102 |
) |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
103 |
|
14149 | 104 |
) |
6520 | 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 |
||
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
124 |
^ |
6520 | 125 |
#(Menu |
14149 | 126 |
( |
127 |
(MenuItem |
|
128 |
label: 'File' |
|
129 |
translateLabel: true |
|
130 |
submenu: |
|
131 |
(Menu |
|
132 |
( |
|
133 |
(MenuItem |
|
134 |
label: 'Open Modal Box' |
|
135 |
itemValue: openModalBox |
|
136 |
translateLabel: true |
|
137 |
) |
|
138 |
(MenuItem |
|
139 |
label: 'Exit' |
|
140 |
itemValue: closeRequest |
|
141 |
translateLabel: true |
|
142 |
) |
|
143 |
) |
|
144 |
nil |
|
145 |
nil |
|
146 |
) |
|
147 |
) |
|
148 |
(MenuItem |
|
149 |
label: 'Filter' |
|
150 |
translateLabel: true |
|
151 |
submenu: |
|
152 |
(Menu |
|
153 |
( |
|
154 |
(MenuItem |
|
155 |
label: 'Show ButtonMotion Events' |
|
156 |
itemValue: showButtonMotion: |
|
157 |
translateLabel: true |
|
158 |
indication: showButtonMotion |
|
159 |
) |
|
160 |
(MenuItem |
|
161 |
label: 'Show Focus Events' |
|
162 |
itemValue: showFocusEvents: |
|
163 |
translateLabel: true |
|
164 |
indication: showFocusEvents |
|
165 |
) |
|
166 |
) |
|
167 |
nil |
|
168 |
nil |
|
169 |
) |
|
170 |
) |
|
171 |
(MenuItem |
|
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 |
) |
|
189 |
(MenuItem |
|
190 |
label: '-' |
|
191 |
) |
|
192 |
(MenuItem |
|
193 |
label: 'Show Timestamp' |
|
194 |
itemValue: showTimestamp: |
|
195 |
translateLabel: true |
|
196 |
indication: showTimestamp |
|
197 |
) |
|
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 |
|
6520 | 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:[ |
|
14149 | 242 |
outputSelector := #transcript asValue. |
243 |
outputSelector onChangeEvaluate:[ self outputSelectorChanged ]. |
|
6520 | 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. |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
326 |
start with: |
14149 | 327 |
EventMonitorView open |
6520 | 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:[ |
|
14149 | 347 |
labelHolder value: 'See event trace\on the standard output' withCRs. |
6520 | 348 |
]. |
349 |
outputStream == Transcript ifTrue:[ |
|
14149 | 350 |
labelHolder value: 'See event trace\on the Transcript' withCRs. |
6520 | 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 |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
396 |
|y p lines font| |
6520 | 397 |
|
398 |
self clear. |
|
399 |
lines := labelHolder value asCollectionOfLines. |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
400 |
font := gc font. |
6520 | 401 |
|
402 |
y := (self height - ((font heightOf:'A') * lines size)) // 2. |
|
403 |
lines do:[:eachLine | |
|
14149 | 404 |
p := (self center x - ((font widthOf:eachLine) // 2)) @ y. |
405 |
self displayString:eachLine value x:(p x) y:(p y). |
|
406 |
y := y + (font heightOf:eachLine). |
|
6520 | 407 |
] |
7354 | 408 |
! |
409 |
||
410 |
showEventTime |
|
411 |
self showTimestamp ifTrue:[ |
|
14149 | 412 |
Transcript show:(Timestamp now); show:' '. |
7354 | 413 |
] |
414 |
||
415 |
"Created: / 04-10-2006 / 13:08:27 / cg" |
|
6520 | 416 |
! ! |
417 |
||
418 |
!EventMonitor::EventMonitorView methodsFor:'events'! |
|
19 | 419 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
420 |
buttonMotion:state x:x y:y |
6582 | 421 |
self showButtonMotion ifFalse:[^ self]. |
422 |
||
7354 | 423 |
self showEventTime. |
6520 | 424 |
outputStream nextPutAll:'buttonMotion x:'. |
425 |
x printOn:outputStream. |
|
426 |
outputStream nextPutAll:' y:'. |
|
427 |
y printOn:outputStream. |
|
428 |
outputStream nextPutAll:' state:'. |
|
429 |
state printOn:outputStream. |
|
430 |
outputStream cr. |
|
1117 | 431 |
|
7354 | 432 |
"Modified: / 04-10-2006 / 13:07:53 / cg" |
19 | 433 |
! |
434 |
||
2159 | 435 |
buttonMultiPress:button x:x y:y |
7354 | 436 |
self showEventTime. |
437 |
||
6520 | 438 |
outputStream nextPutAll:'buttonMultiPress x:'. |
439 |
x printOn:outputStream. |
|
440 |
outputStream nextPutAll:' y:'. |
|
441 |
y printOn:outputStream. |
|
442 |
outputStream nextPutAll:' button:'. |
|
443 |
button printOn:outputStream. |
|
444 |
outputStream cr. |
|
2159 | 445 |
|
7354 | 446 |
"Created: / 19-05-1999 / 09:40:40 / cg" |
447 |
"Modified: / 04-10-2006 / 13:08:36 / cg" |
|
2159 | 448 |
! |
449 |
||
19 | 450 |
buttonPress:button x:x y:y |
7354 | 451 |
self showEventTime. |
452 |
||
6520 | 453 |
outputStream nextPutAll:'buttonPress x:'. |
454 |
x printOn:outputStream. |
|
455 |
outputStream nextPutAll:' y:'. |
|
456 |
y printOn:outputStream. |
|
457 |
outputStream nextPutAll:' button:'. |
|
458 |
button printOn:outputStream. |
|
459 |
outputStream cr. |
|
460 |
outputStream flush. |
|
1117 | 461 |
|
7354 | 462 |
"Modified: / 04-10-2006 / 13:08:43 / cg" |
19 | 463 |
! |
464 |
||
465 |
buttonRelease:button x:x y:y |
|
7354 | 466 |
self showEventTime. |
467 |
||
6520 | 468 |
outputStream nextPutAll:'buttonRelease x:'. |
469 |
x printOn:outputStream. |
|
470 |
outputStream nextPutAll:' y:'. |
|
471 |
y printOn:outputStream. |
|
472 |
outputStream nextPutAll:' button:'. |
|
473 |
button printOn:outputStream. |
|
474 |
outputStream cr. |
|
1117 | 475 |
|
7354 | 476 |
"Modified: / 04-10-2006 / 13:08:46 / cg" |
19 | 477 |
! |
478 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
479 |
configureX:x y:y width:newWidth height:newHeight |
7354 | 480 |
self showEventTime. |
481 |
||
6520 | 482 |
outputStream nextPutAll:'configure x:'. |
483 |
x printOn:outputStream. |
|
484 |
outputStream nextPutAll:' y:'. |
|
485 |
y printOn:outputStream. |
|
486 |
outputStream nextPutAll:' width:'. |
|
487 |
newWidth printOn:outputStream. |
|
488 |
outputStream nextPutAll:' height:'. |
|
489 |
newHeight printOn:outputStream. |
|
490 |
outputStream nextPutAll:' button:'. |
|
491 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
492 |
|
6520 | 493 |
super configureX:x y:y width:newWidth height:newHeight. |
494 |
||
495 |
self invalidate. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
496 |
|
7354 | 497 |
"Modified: / 04-10-2006 / 13:08:49 / cg" |
1117 | 498 |
! |
499 |
||
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
500 |
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
|
501 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
502 |
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
|
503 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
504 |
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
|
505 |
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
|
506 |
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
|
507 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
508 |
|
7320 | 509 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
510 |
event isButtonMotionEvent ifTrue:[ |
|
14149 | 511 |
self showButtonMotion ifFalse:[^ self]. |
7320 | 512 |
]. |
513 |
||
514 |
"/ Timestamp now printOn:outputStream. |
|
515 |
"/ outputStream nextPutAll:' '. |
|
516 |
||
517 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate. |
|
518 |
||
519 |
"Created: / 20-09-2006 / 10:29:38 / cg" |
|
520 |
! |
|
521 |
||
1117 | 522 |
dropMessage:dropType data:dropData |
7354 | 523 |
self showEventTime. |
524 |
||
6520 | 525 |
outputStream nextPutAll:'drop '. |
526 |
dropType printOn:outputStream. |
|
527 |
outputStream nextPutAll:' data:'. |
|
528 |
dropData printOn:outputStream. |
|
529 |
outputStream cr. |
|
1117 | 530 |
|
7354 | 531 |
"Modified: / 04-10-2006 / 13:09:13 / cg" |
433
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 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
534 |
focusIn |
7353 | 535 |
self showFocusEvents ifFalse:[^ self]. |
536 |
||
7354 | 537 |
self showEventTime. |
538 |
||
6520 | 539 |
outputStream nextPutLine:'focusIn '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
540 |
|
7353 | 541 |
"Created: / 07-03-1996 / 15:06:18 / cg" |
7354 | 542 |
"Modified: / 04-10-2006 / 13:09:17 / cg" |
433
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 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
545 |
focusOut |
7353 | 546 |
self showFocusEvents ifFalse:[^ self]. |
547 |
||
7354 | 548 |
self showEventTime. |
549 |
||
6520 | 550 |
outputStream nextPutLine:'focusOut '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
551 |
|
7353 | 552 |
"Created: / 07-03-1996 / 15:06:21 / cg" |
7354 | 553 |
"Modified: / 04-10-2006 / 13:09:20 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
554 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
555 |
|
2159 | 556 |
hasKeyboardFocus:aBoolen |
7353 | 557 |
self showFocusEvents ifFalse:[^ self]. |
558 |
||
7354 | 559 |
self showEventTime. |
560 |
||
6520 | 561 |
outputStream nextPutAll:'hasKeyboardFocus:'. |
562 |
aBoolen printOn:outputStream. |
|
563 |
outputStream cr. |
|
2159 | 564 |
|
7354 | 565 |
"Modified: / 04-10-2006 / 13:09:23 / cg" |
2159 | 566 |
! |
567 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
568 |
keyPress:key x:x y:y |
6344 | 569 |
|s rawKey untranslatedKey| |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
570 |
|
7354 | 571 |
self showEventTime. |
572 |
||
2805 | 573 |
s := 'KeyPress x:' , x printString , ' y:' , y printString. |
6520 | 574 |
s printOn:outputStream. |
6344 | 575 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
576 |
(key isMemberOf:Character) ifTrue:[ |
14149 | 577 |
s := ' character key:' , key storeString |
578 |
, ' (' , key asciiValue printString , ')'. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
579 |
] ifFalse:[ |
14149 | 580 |
s := ' symbolic key:' , key storeString. |
581 |
untranslatedKey := self graphicsDevice keyboardMap keyAtValue:key ifAbsent:key. |
|
582 |
untranslatedKey ~~ key ifTrue:[ |
|
583 |
s := s , ' untranslated key:' , untranslatedKey storeString |
|
584 |
]. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
585 |
]. |
6344 | 586 |
rawKey := (WindowGroup lastEventQuerySignal query) rawKey. |
6582 | 587 |
s := s , ' rawKey:' , rawKey storeString. |
6344 | 588 |
|
6520 | 589 |
s printOn:outputStream. |
7354 | 590 |
|
591 |
key isCharacter ifTrue:[ |
|
14149 | 592 |
outputStream nextPutAll:' '''. |
593 |
key asString printOn:outputStream. |
|
594 |
outputStream nextPutAll:''''. |
|
7354 | 595 |
]. |
6520 | 596 |
outputStream cr. |
7354 | 597 |
|
598 |
"Modified: / 04-10-2006 / 13:12:07 / cg" |
|
433
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 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
601 |
keyRelease:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
602 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
603 |
|
7354 | 604 |
self showEventTime. |
605 |
||
6520 | 606 |
'KeyRelease x:' printOn:outputStream. |
607 |
x printOn:outputStream. |
|
608 |
' y:' printOn:outputStream. |
|
609 |
y printOn:outputStream. |
|
610 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
611 |
(key isMemberOf:Character) ifTrue:[ |
14149 | 612 |
key codePoint <= 16rFF ifTrue:[ |
613 |
' character key:' printOn:outputStream. |
|
614 |
key storeString printOn:outputStream. |
|
615 |
] ifFalse:[ |
|
616 |
' unicode character utf8:' printOn:outputStream. |
|
617 |
key asString utf8Encoded asByteArray hexPrintOn:outputStream. |
|
618 |
]. |
|
619 |
' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
620 |
] ifFalse:[ |
14149 | 621 |
' symbolic key:' print. key storeString printOn:outputStream. |
622 |
untranslatedKey := self graphicsDevice keyboardMap keyAtValue:key ifAbsent:key. |
|
623 |
untranslatedKey ~~ key ifTrue:[ |
|
624 |
' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream |
|
625 |
] |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
626 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
627 |
|
6520 | 628 |
outputStream cr |
7354 | 629 |
|
630 |
"Modified: / 04-10-2006 / 13:09:27 / cg" |
|
433
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 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
633 |
mapped |
7354 | 634 |
self showEventTime. |
635 |
||
6520 | 636 |
outputStream nextPutLine:'mapped '. |
637 |
||
1977 | 638 |
super mapped. |
1117 | 639 |
|
7354 | 640 |
"Modified: / 04-10-2006 / 13:09:31 / cg" |
45 | 641 |
! |
642 |
||
52 | 643 |
pointerEnter:state x:x y:y |
7354 | 644 |
self showEventTime. |
645 |
||
6520 | 646 |
outputStream nextPutAll:'pointerEnter x:'. |
647 |
x printOn:outputStream. |
|
648 |
outputStream nextPutAll:' y:'. |
|
649 |
y printOn:outputStream. |
|
650 |
outputStream nextPutAll:' state:'. |
|
651 |
state printOn:outputStream. |
|
652 |
outputStream cr. |
|
1117 | 653 |
|
7354 | 654 |
"Modified: / 04-10-2006 / 13:09:34 / cg" |
52 | 655 |
! |
656 |
||
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
657 |
pointerLeave:state |
7354 | 658 |
self showEventTime. |
659 |
||
6520 | 660 |
outputStream nextPutAll:'pointerLeave state:'. |
661 |
state storeString printOn:outputStream. |
|
662 |
outputStream cr. |
|
1117 | 663 |
|
7354 | 664 |
"Modified: / 04-10-2006 / 13:09:36 / cg" |
52 | 665 |
! |
666 |
||
6582 | 667 |
sizeChanged:how |
8089 | 668 |
outputStream nextPutAll:'sizeChanged how:'. |
669 |
how printOn:outputStream. |
|
670 |
outputStream cr. |
|
671 |
||
6582 | 672 |
super sizeChanged:how. |
673 |
self invalidate |
|
7354 | 674 |
|
675 |
"Modified: / 04-10-2006 / 13:17:46 / cg" |
|
6582 | 676 |
! |
677 |
||
45 | 678 |
unmapped |
7354 | 679 |
self showEventTime. |
680 |
||
6520 | 681 |
outputStream nextPutLine:'unmapped '. |
682 |
||
1977 | 683 |
super unmapped. |
1117 | 684 |
|
7354 | 685 |
"Modified: / 04-10-2006 / 13:09:41 / cg" |
45 | 686 |
! |
687 |
||
688 |
visibilityChange:how |
|
7354 | 689 |
self showEventTime. |
690 |
||
6520 | 691 |
outputStream nextPutAll:'visibilityChange:'. |
692 |
how storeString printOn:outputStream. |
|
693 |
outputStream cr. |
|
694 |
||
1977 | 695 |
super visibilityChange:how |
1117 | 696 |
|
7354 | 697 |
"Modified: / 04-10-2006 / 13:09:43 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
698 |
! ! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
699 |
|
6520 | 700 |
!EventMonitor::EventMonitorView methodsFor:'initialization'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
701 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
702 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
703 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
704 |
|
6520 | 705 |
labelHolder := '' asValue. |
706 |
self outputStream:Stdout. |
|
19 | 707 |
! ! |
708 |
||
6520 | 709 |
!EventMonitor::EventMonitorView methodsFor:'realization'! |
19 | 710 |
|
711 |
initEvents |
|
712 |
self enableMotionEvents. |
|
45 | 713 |
self enableKeyReleaseEvents. |
52 | 714 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
715 |
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
|
716 |
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
|
717 |
"/ 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
|
718 |
"/ self enableEvent:#substructureNotify. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
719 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
720 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 721 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
722 |
|
1021 | 723 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
724 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
725 |
version |
14149 | 726 |
^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.32 2014-03-20 12:53:40 stefan Exp $' |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
727 |
! ! |
14149 | 728 |