author | Claus Gittinger <cg@exept.de> |
Sat, 13 Jul 2019 13:59:16 +0200 | |
changeset 18894 | 1b99fefd5825 |
parent 18603 | 305ec45cf83b |
child 19249 | e88448674061 |
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 |
18603 | 349 |
|where| |
350 |
||
7353 | 351 |
outputStream := aStream. |
6520 | 352 |
|
353 |
labelHolder value:nil. |
|
18603 | 354 |
where := 'the Transcript'. |
6520 | 355 |
outputStream == Stdout ifTrue:[ |
18603 | 356 |
where := 'standard output'. |
6520 | 357 |
]. |
18603 | 358 |
outputStream == Stderr ifTrue:[ |
359 |
where := 'standard error'. |
|
6520 | 360 |
]. |
18603 | 361 |
labelHolder value:(c'See event trace\non the ',where). |
362 |
||
6582 | 363 |
self invalidate. |
7353 | 364 |
|
365 |
"Modified: / 04-10-2006 / 13:04:16 / cg" |
|
18603 | 366 |
"Modified: / 20-02-2019 / 10:21:48 / Claus Gittinger" |
6582 | 367 |
! |
368 |
||
369 |
showButtonMotion |
|
7353 | 370 |
^ showButtonMotion ? false |
371 |
||
372 |
"Modified: / 04-10-2006 / 13:03:31 / cg" |
|
373 |
! |
|
374 |
||
375 |
showButtonMotion:aBoolean |
|
376 |
showButtonMotion := aBoolean. |
|
377 |
||
378 |
"Modified: / 04-10-2006 / 13:04:08 / cg" |
|
6582 | 379 |
! |
380 |
||
7353 | 381 |
showFocusEvents |
382 |
^ showFocusEvents ? true |
|
383 |
||
384 |
"Created: / 04-10-2006 / 13:03:48 / cg" |
|
385 |
! |
|
386 |
||
387 |
showFocusEvents:aBoolean |
|
388 |
showFocusEvents := aBoolean. |
|
389 |
||
390 |
"Created: / 04-10-2006 / 13:04:04 / cg" |
|
7354 | 391 |
! |
392 |
||
393 |
showTimestamp |
|
394 |
^ showTimestamp ? false |
|
395 |
||
396 |
"Created: / 04-10-2006 / 13:06:57 / cg" |
|
397 |
! |
|
398 |
||
399 |
showTimestamp:aBoolean |
|
400 |
showTimestamp := aBoolean. |
|
401 |
||
402 |
"Created: / 04-10-2006 / 13:07:02 / cg" |
|
6520 | 403 |
! ! |
404 |
||
405 |
!EventMonitor::EventMonitorView methodsFor:'drawing'! |
|
406 |
||
407 |
redraw |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
408 |
|y p lines font| |
6520 | 409 |
|
410 |
self clear. |
|
411 |
lines := labelHolder value asCollectionOfLines. |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
412 |
font := gc font. |
6520 | 413 |
|
414 |
y := (self height - ((font heightOf:'A') * lines size)) // 2. |
|
415 |
lines do:[:eachLine | |
|
14149 | 416 |
p := (self center x - ((font widthOf:eachLine) // 2)) @ y. |
417 |
self displayString:eachLine value x:(p x) y:(p y). |
|
418 |
y := y + (font heightOf:eachLine). |
|
6520 | 419 |
] |
7354 | 420 |
! |
421 |
||
422 |
showEventTime |
|
423 |
self showTimestamp ifTrue:[ |
|
14149 | 424 |
Transcript show:(Timestamp now); show:' '. |
7354 | 425 |
] |
426 |
||
427 |
"Created: / 04-10-2006 / 13:08:27 / cg" |
|
6520 | 428 |
! ! |
429 |
||
430 |
!EventMonitor::EventMonitorView methodsFor:'events'! |
|
19 | 431 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
432 |
buttonMotion:state x:x y:y |
6582 | 433 |
self showButtonMotion ifFalse:[^ self]. |
434 |
||
7354 | 435 |
self showEventTime. |
6520 | 436 |
outputStream nextPutAll:'buttonMotion x:'. |
437 |
x printOn:outputStream. |
|
438 |
outputStream nextPutAll:' y:'. |
|
439 |
y printOn:outputStream. |
|
440 |
outputStream nextPutAll:' state:'. |
|
441 |
state printOn:outputStream. |
|
442 |
outputStream cr. |
|
1117 | 443 |
|
7354 | 444 |
"Modified: / 04-10-2006 / 13:07:53 / cg" |
19 | 445 |
! |
446 |
||
2159 | 447 |
buttonMultiPress:button x:x y:y |
7354 | 448 |
self showEventTime. |
449 |
||
6520 | 450 |
outputStream nextPutAll:'buttonMultiPress x:'. |
451 |
x printOn:outputStream. |
|
452 |
outputStream nextPutAll:' y:'. |
|
453 |
y printOn:outputStream. |
|
454 |
outputStream nextPutAll:' button:'. |
|
455 |
button printOn:outputStream. |
|
456 |
outputStream cr. |
|
2159 | 457 |
|
7354 | 458 |
"Created: / 19-05-1999 / 09:40:40 / cg" |
459 |
"Modified: / 04-10-2006 / 13:08:36 / cg" |
|
2159 | 460 |
! |
461 |
||
19 | 462 |
buttonPress:button x:x y:y |
18585 | 463 |
|sensor| |
464 |
||
7354 | 465 |
self showEventTime. |
466 |
||
6520 | 467 |
outputStream nextPutAll:'buttonPress x:'. |
468 |
x printOn:outputStream. |
|
469 |
outputStream nextPutAll:' y:'. |
|
470 |
y printOn:outputStream. |
|
471 |
outputStream nextPutAll:' button:'. |
|
472 |
button printOn:outputStream. |
|
18585 | 473 |
|
474 |
sensor := self sensor. |
|
475 |
sensor shiftDown ifTrue:[ |
|
17383 | 476 |
outputStream nextPutAll:' +shift'. |
477 |
]. |
|
18585 | 478 |
sensor ctrlDown ifTrue:[ |
17383 | 479 |
outputStream nextPutAll:' +ctrl'. |
480 |
]. |
|
18585 | 481 |
sensor altDown ifTrue:[ |
17383 | 482 |
outputStream nextPutAll:' +alt'. |
483 |
]. |
|
18585 | 484 |
sensor metaDown ifTrue:[ |
17383 | 485 |
outputStream nextPutAll:' +meta'. |
486 |
]. |
|
6520 | 487 |
outputStream cr. |
488 |
outputStream flush. |
|
1117 | 489 |
|
17383 | 490 |
"Modified: / 10-02-2017 / 21:21:48 / cg" |
18585 | 491 |
"Modified: / 13-02-2019 / 12:51:51 / Claus Gittinger" |
19 | 492 |
! |
493 |
||
494 |
buttonRelease:button x:x y:y |
|
7354 | 495 |
self showEventTime. |
496 |
||
6520 | 497 |
outputStream nextPutAll:'buttonRelease x:'. |
498 |
x printOn:outputStream. |
|
499 |
outputStream nextPutAll:' y:'. |
|
500 |
y printOn:outputStream. |
|
501 |
outputStream nextPutAll:' button:'. |
|
502 |
button printOn:outputStream. |
|
503 |
outputStream cr. |
|
1117 | 504 |
|
7354 | 505 |
"Modified: / 04-10-2006 / 13:08:46 / cg" |
19 | 506 |
! |
507 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
508 |
configureX:x y:y width:newWidth height:newHeight |
7354 | 509 |
self showEventTime. |
510 |
||
6520 | 511 |
outputStream nextPutAll:'configure x:'. |
512 |
x printOn:outputStream. |
|
513 |
outputStream nextPutAll:' y:'. |
|
514 |
y printOn:outputStream. |
|
515 |
outputStream nextPutAll:' width:'. |
|
516 |
newWidth printOn:outputStream. |
|
517 |
outputStream nextPutAll:' height:'. |
|
518 |
newHeight printOn:outputStream. |
|
519 |
outputStream nextPutAll:' button:'. |
|
520 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
521 |
|
6520 | 522 |
super configureX:x y:y width:newWidth height:newHeight. |
523 |
||
524 |
self invalidate. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
525 |
|
7354 | 526 |
"Modified: / 04-10-2006 / 13:08:49 / cg" |
1117 | 527 |
! |
528 |
||
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
529 |
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
|
530 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
531 |
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
|
532 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
533 |
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
|
534 |
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
|
535 |
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
|
536 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
537 |
|
7320 | 538 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
539 |
event isButtonMotionEvent ifTrue:[ |
|
14149 | 540 |
self showButtonMotion ifFalse:[^ self]. |
7320 | 541 |
]. |
542 |
||
543 |
"/ Timestamp now printOn:outputStream. |
|
544 |
"/ outputStream nextPutAll:' '. |
|
545 |
||
546 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate. |
|
547 |
||
548 |
"Created: / 20-09-2006 / 10:29:38 / cg" |
|
549 |
! |
|
550 |
||
1117 | 551 |
dropMessage:dropType data:dropData |
7354 | 552 |
self showEventTime. |
553 |
||
6520 | 554 |
outputStream nextPutAll:'drop '. |
555 |
dropType printOn:outputStream. |
|
556 |
outputStream nextPutAll:' data:'. |
|
557 |
dropData printOn:outputStream. |
|
558 |
outputStream cr. |
|
1117 | 559 |
|
7354 | 560 |
"Modified: / 04-10-2006 / 13:09:13 / 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 |
focusIn |
7353 | 564 |
self showFocusEvents ifFalse:[^ self]. |
565 |
||
7354 | 566 |
self showEventTime. |
567 |
||
6520 | 568 |
outputStream nextPutLine:'focusIn '. |
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:18 / cg" |
7354 | 571 |
"Modified: / 04-10-2006 / 13:09:17 / 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 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
574 |
focusOut |
7353 | 575 |
self showFocusEvents ifFalse:[^ self]. |
576 |
||
7354 | 577 |
self showEventTime. |
578 |
||
6520 | 579 |
outputStream nextPutLine:'focusOut '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
580 |
|
7353 | 581 |
"Created: / 07-03-1996 / 15:06:21 / cg" |
7354 | 582 |
"Modified: / 04-10-2006 / 13:09:20 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
583 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
584 |
|
2159 | 585 |
hasKeyboardFocus:aBoolen |
7353 | 586 |
self showFocusEvents ifFalse:[^ self]. |
587 |
||
7354 | 588 |
self showEventTime. |
589 |
||
6520 | 590 |
outputStream nextPutAll:'hasKeyboardFocus:'. |
591 |
aBoolen printOn:outputStream. |
|
592 |
outputStream cr. |
|
2159 | 593 |
|
7354 | 594 |
"Modified: / 04-10-2006 / 13:09:23 / cg" |
2159 | 595 |
! |
596 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
597 |
keyPress:key x:x y:y |
6344 | 598 |
|s rawKey untranslatedKey| |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
599 |
|
7354 | 600 |
self showEventTime. |
601 |
||
2805 | 602 |
s := 'KeyPress x:' , x printString , ' y:' , y printString. |
6520 | 603 |
s printOn:outputStream. |
6344 | 604 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
605 |
(key isMemberOf:Character) ifTrue:[ |
14149 | 606 |
s := ' character key:' , key storeString |
607 |
, ' (' , key asciiValue printString , ')'. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
608 |
] ifFalse:[ |
14149 | 609 |
s := ' symbolic key:' , key storeString. |
16250 | 610 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
14149 | 611 |
untranslatedKey ~~ key ifTrue:[ |
612 |
s := s , ' untranslated key:' , untranslatedKey storeString |
|
613 |
]. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
614 |
]. |
18328 | 615 |
rawKey := (WindowGroup lastEvent) rawKey. |
6582 | 616 |
s := s , ' rawKey:' , rawKey storeString. |
6344 | 617 |
|
6520 | 618 |
s printOn:outputStream. |
7354 | 619 |
|
620 |
key isCharacter ifTrue:[ |
|
14149 | 621 |
outputStream nextPutAll:' '''. |
622 |
key asString printOn:outputStream. |
|
623 |
outputStream nextPutAll:''''. |
|
7354 | 624 |
]. |
6520 | 625 |
outputStream cr. |
7354 | 626 |
|
627 |
"Modified: / 04-10-2006 / 13:12:07 / cg" |
|
18328 | 628 |
"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
|
629 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
630 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
631 |
keyRelease:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
632 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
633 |
|
7354 | 634 |
self showEventTime. |
635 |
||
6520 | 636 |
'KeyRelease x:' printOn:outputStream. |
637 |
x printOn:outputStream. |
|
638 |
' y:' printOn:outputStream. |
|
639 |
y printOn:outputStream. |
|
640 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
641 |
(key isMemberOf:Character) ifTrue:[ |
14149 | 642 |
key codePoint <= 16rFF ifTrue:[ |
643 |
' character key:' printOn:outputStream. |
|
644 |
key storeString printOn:outputStream. |
|
645 |
] ifFalse:[ |
|
646 |
' unicode character utf8:' printOn:outputStream. |
|
647 |
key asString utf8Encoded asByteArray hexPrintOn:outputStream. |
|
648 |
]. |
|
649 |
' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
650 |
] ifFalse:[ |
14149 | 651 |
' symbolic key:' print. key storeString printOn:outputStream. |
16250 | 652 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
14149 | 653 |
untranslatedKey ~~ key ifTrue:[ |
654 |
' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream |
|
655 |
] |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
656 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
657 |
|
6520 | 658 |
outputStream cr |
7354 | 659 |
|
660 |
"Modified: / 04-10-2006 / 13:09:27 / cg" |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
661 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
662 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
663 |
mapped |
7354 | 664 |
self showEventTime. |
665 |
||
6520 | 666 |
outputStream nextPutLine:'mapped '. |
667 |
||
1977 | 668 |
super mapped. |
1117 | 669 |
|
7354 | 670 |
"Modified: / 04-10-2006 / 13:09:31 / cg" |
45 | 671 |
! |
672 |
||
52 | 673 |
pointerEnter:state x:x y:y |
7354 | 674 |
self showEventTime. |
675 |
||
6520 | 676 |
outputStream nextPutAll:'pointerEnter x:'. |
677 |
x printOn:outputStream. |
|
678 |
outputStream nextPutAll:' y:'. |
|
679 |
y printOn:outputStream. |
|
680 |
outputStream nextPutAll:' state:'. |
|
681 |
state printOn:outputStream. |
|
682 |
outputStream cr. |
|
1117 | 683 |
|
7354 | 684 |
"Modified: / 04-10-2006 / 13:09:34 / cg" |
52 | 685 |
! |
686 |
||
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
687 |
pointerLeave:state |
7354 | 688 |
self showEventTime. |
689 |
||
6520 | 690 |
outputStream nextPutAll:'pointerLeave state:'. |
691 |
state storeString printOn:outputStream. |
|
692 |
outputStream cr. |
|
1117 | 693 |
|
7354 | 694 |
"Modified: / 04-10-2006 / 13:09:36 / cg" |
52 | 695 |
! |
696 |
||
6582 | 697 |
sizeChanged:how |
8089 | 698 |
outputStream nextPutAll:'sizeChanged how:'. |
699 |
how printOn:outputStream. |
|
700 |
outputStream cr. |
|
701 |
||
6582 | 702 |
super sizeChanged:how. |
703 |
self invalidate |
|
7354 | 704 |
|
705 |
"Modified: / 04-10-2006 / 13:17:46 / cg" |
|
6582 | 706 |
! |
707 |
||
45 | 708 |
unmapped |
7354 | 709 |
self showEventTime. |
710 |
||
6520 | 711 |
outputStream nextPutLine:'unmapped '. |
712 |
||
1977 | 713 |
super unmapped. |
1117 | 714 |
|
7354 | 715 |
"Modified: / 04-10-2006 / 13:09:41 / cg" |
45 | 716 |
! |
717 |
||
718 |
visibilityChange:how |
|
7354 | 719 |
self showEventTime. |
720 |
||
6520 | 721 |
outputStream nextPutAll:'visibilityChange:'. |
722 |
how storeString printOn:outputStream. |
|
723 |
outputStream cr. |
|
724 |
||
1977 | 725 |
super visibilityChange:how |
1117 | 726 |
|
7354 | 727 |
"Modified: / 04-10-2006 / 13:09:43 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
728 |
! ! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
729 |
|
6520 | 730 |
!EventMonitor::EventMonitorView methodsFor:'initialization'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
731 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
732 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
733 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
734 |
|
6520 | 735 |
labelHolder := '' asValue. |
736 |
self outputStream:Stdout. |
|
19 | 737 |
! ! |
738 |
||
6520 | 739 |
!EventMonitor::EventMonitorView methodsFor:'realization'! |
19 | 740 |
|
741 |
initEvents |
|
742 |
self enableMotionEvents. |
|
45 | 743 |
self enableKeyReleaseEvents. |
52 | 744 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
745 |
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
|
746 |
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
|
747 |
"/ 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
|
748 |
"/ self enableEvent:#substructureNotify. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
749 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
750 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 751 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
752 |
|
1021 | 753 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
754 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
755 |
version |
16250 | 756 |
^ '$Header$' |
18586 | 757 |
! |
758 |
||
759 |
version_CVS |
|
760 |
^ '$Header$' |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
761 |
! ! |
14149 | 762 |