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