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