author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 19297 | 746ba9ddc3ff |
child 19542 | 0fd63185f1c2 |
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 |
19255 | 27 |
showTimestamp showPointerEvents' |
16250 | 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 |
) |
|
19255 | 170 |
(MenuItem |
171 |
label: 'Show Pointer Events' |
|
172 |
itemValue: showPointerEvents: |
|
173 |
translateLabel: true |
|
174 |
indication: showPointerEvents |
|
175 |
) |
|
14149 | 176 |
) |
177 |
nil |
|
178 |
nil |
|
179 |
) |
|
180 |
) |
|
181 |
(MenuItem |
|
182 |
label: 'Output' |
|
183 |
translateLabel: true |
|
184 |
submenu: |
|
185 |
(Menu |
|
186 |
( |
|
187 |
(MenuItem |
|
188 |
label: 'Stdout' |
|
189 |
translateLabel: true |
|
190 |
choice: outputSelector |
|
191 |
choiceValue: stdout |
|
192 |
) |
|
193 |
(MenuItem |
|
194 |
label: 'Transcript' |
|
195 |
translateLabel: true |
|
196 |
choice: outputSelector |
|
197 |
choiceValue: transcript |
|
198 |
) |
|
199 |
(MenuItem |
|
200 |
label: '-' |
|
201 |
) |
|
202 |
(MenuItem |
|
203 |
label: 'Show Timestamp' |
|
204 |
itemValue: showTimestamp: |
|
205 |
translateLabel: true |
|
206 |
indication: showTimestamp |
|
207 |
) |
|
208 |
) |
|
209 |
nil |
|
210 |
nil |
|
211 |
) |
|
212 |
) |
|
213 |
(MenuItem |
|
214 |
label: 'Help' |
|
215 |
translateLabel: true |
|
216 |
startGroup: right |
|
217 |
submenu: |
|
218 |
(Menu |
|
219 |
( |
|
220 |
(MenuItem |
|
221 |
label: 'Documentation' |
|
222 |
itemValue: openDocumentation |
|
223 |
translateLabel: true |
|
224 |
) |
|
225 |
(MenuItem |
|
226 |
label: '-' |
|
227 |
) |
|
228 |
(MenuItem |
|
229 |
label: 'About this Application' |
|
230 |
itemValue: openAboutThisApplication |
|
231 |
translateLabel: true |
|
232 |
) |
|
233 |
) |
|
234 |
nil |
|
235 |
nil |
|
236 |
) |
|
237 |
) |
|
238 |
) |
|
239 |
nil |
|
240 |
nil |
|
6520 | 241 |
) |
242 |
! ! |
|
243 |
||
244 |
!EventMonitor methodsFor:'aspects'! |
|
245 |
||
6582 | 246 |
eventMonitorView |
247 |
^ (self builder componentAt:#eventMonitorView) |
|
248 |
! |
|
249 |
||
6520 | 250 |
outputSelector |
251 |
outputSelector isNil ifTrue:[ |
|
14149 | 252 |
outputSelector := #transcript asValue. |
253 |
outputSelector onChangeEvaluate:[ self outputSelectorChanged ]. |
|
6520 | 254 |
]. |
255 |
^ outputSelector |
|
256 |
! |
|
257 |
||
258 |
outputSelectorChanged |
|
259 |
|stream| |
|
260 |
||
261 |
stream := self outputSelector value == #transcript ifTrue:[Transcript] ifFalse:[Stdout]. |
|
6582 | 262 |
self eventMonitorView outputStream:stream. |
263 |
! |
|
264 |
||
6759
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
265 |
postBuildWith:aBuilder |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
266 |
super postBuildWith:aBuilder. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
267 |
self outputSelectorChanged. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
268 |
! |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
269 |
|
6582 | 270 |
showButtonMotion |
271 |
^ self eventMonitorView showButtonMotion |
|
272 |
! |
|
273 |
||
274 |
showButtonMotion:aBoolean |
|
275 |
^ self eventMonitorView showButtonMotion:aBoolean |
|
7353 | 276 |
! |
277 |
||
278 |
showFocusEvents |
|
279 |
^ self eventMonitorView showFocusEvents |
|
280 |
||
281 |
"Created: / 04-10-2006 / 13:05:16 / cg" |
|
282 |
! |
|
283 |
||
284 |
showFocusEvents:aBoolean |
|
285 |
^ self eventMonitorView showFocusEvents:aBoolean |
|
286 |
||
287 |
"Created: / 04-10-2006 / 13:05:19 / cg" |
|
7354 | 288 |
! |
289 |
||
19255 | 290 |
showPointerEvents |
291 |
^ self eventMonitorView showPointerEvents |
|
292 |
||
293 |
"Created: / 04-10-2006 / 13:05:16 / cg" |
|
294 |
! |
|
295 |
||
296 |
showPointerEvents:aBoolean |
|
297 |
^ self eventMonitorView showPointerEvents:aBoolean |
|
298 |
||
299 |
"Created: / 04-10-2006 / 13:05:19 / cg" |
|
300 |
! |
|
301 |
||
7354 | 302 |
showTimestamp |
303 |
^ self eventMonitorView showTimestamp |
|
304 |
||
305 |
"Created: / 04-10-2006 / 13:14:49 / cg" |
|
306 |
! |
|
307 |
||
308 |
showTimestamp:aBoolean |
|
309 |
^ self eventMonitorView showTimestamp:aBoolean |
|
310 |
||
311 |
"Created: / 04-10-2006 / 13:14:53 / cg" |
|
6520 | 312 |
! ! |
313 |
||
314 |
!EventMonitor methodsFor:'menu actions'! |
|
315 |
||
316 |
openAboutThisApplication |
|
317 |
"This method was generated by the Browser. |
|
318 |
It will be invoked when the menu-item 'help-about' is selected." |
|
319 |
||
320 |
"/ could open a customized aboutBox here ... |
|
321 |
super openAboutThisApplication |
|
322 |
! |
|
323 |
||
324 |
openDocumentation |
|
19249 | 325 |
"Called when <F1> is pressed" |
326 |
||
6520 | 327 |
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
|
328 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
329 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
330 |
openModalBox |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
331 |
Dialog information:'Modal Box' |
6520 | 332 |
! ! |
333 |
||
334 |
!EventMonitor::EventMonitorView class methodsFor:'defaults'! |
|
335 |
||
336 |
defaultExtent |
|
337 |
^ 200 @ 200 |
|
338 |
! |
|
339 |
||
340 |
defaultLabel |
|
341 |
^ 'Event Monitor' |
|
342 |
! ! |
|
343 |
||
344 |
!EventMonitor::EventMonitorView class methodsFor:'documentation'! |
|
345 |
||
346 |
documentation |
|
347 |
" |
|
348 |
like xev - show events. |
|
349 |
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
|
350 |
start with: |
14149 | 351 |
EventMonitorView open |
6520 | 352 |
and watch the output on xterm. |
17383 | 353 |
|
19253 | 354 |
Caveat: |
355 |
This is one of the oldest apps inside ST/X. Don't look too deep into the code... |
|
6520 | 356 |
" |
357 |
! ! |
|
358 |
||
359 |
!EventMonitor::EventMonitorView class methodsFor:'startup'! |
|
1822 | 360 |
|
361 |
isVisualStartable |
|
362 |
^ true |
|
363 |
||
364 |
"Created: / 10.8.1998 / 16:03:13 / cg" |
|
365 |
! ! |
|
366 |
||
6520 | 367 |
!EventMonitor::EventMonitorView methodsFor:'accessing'! |
368 |
||
7353 | 369 |
outputStream:aStream |
18603 | 370 |
|where| |
371 |
||
7353 | 372 |
outputStream := aStream. |
6520 | 373 |
|
374 |
labelHolder value:nil. |
|
18603 | 375 |
where := 'the Transcript'. |
6520 | 376 |
outputStream == Stdout ifTrue:[ |
18603 | 377 |
where := 'standard output'. |
6520 | 378 |
]. |
18603 | 379 |
outputStream == Stderr ifTrue:[ |
380 |
where := 'standard error'. |
|
6520 | 381 |
]. |
18603 | 382 |
labelHolder value:(c'See event trace\non the ',where). |
383 |
||
6582 | 384 |
self invalidate. |
7353 | 385 |
|
386 |
"Modified: / 04-10-2006 / 13:04:16 / cg" |
|
18603 | 387 |
"Modified: / 20-02-2019 / 10:21:48 / Claus Gittinger" |
6582 | 388 |
! |
389 |
||
390 |
showButtonMotion |
|
7353 | 391 |
^ showButtonMotion ? false |
392 |
||
393 |
"Modified: / 04-10-2006 / 13:03:31 / cg" |
|
394 |
! |
|
395 |
||
396 |
showButtonMotion:aBoolean |
|
397 |
showButtonMotion := aBoolean. |
|
398 |
||
399 |
"Modified: / 04-10-2006 / 13:04:08 / cg" |
|
6582 | 400 |
! |
401 |
||
7353 | 402 |
showFocusEvents |
403 |
^ showFocusEvents ? true |
|
404 |
||
405 |
"Created: / 04-10-2006 / 13:03:48 / cg" |
|
406 |
! |
|
407 |
||
408 |
showFocusEvents:aBoolean |
|
409 |
showFocusEvents := aBoolean. |
|
410 |
||
411 |
"Created: / 04-10-2006 / 13:04:04 / cg" |
|
7354 | 412 |
! |
413 |
||
19255 | 414 |
showPointerEvents |
415 |
^ showPointerEvents ? true |
|
416 |
||
417 |
"Created: / 04-10-2006 / 13:03:48 / cg" |
|
418 |
! |
|
419 |
||
420 |
showPointerEvents:aBoolean |
|
421 |
showPointerEvents := aBoolean. |
|
422 |
||
423 |
"Created: / 04-10-2006 / 13:04:04 / cg" |
|
424 |
! |
|
425 |
||
7354 | 426 |
showTimestamp |
427 |
^ showTimestamp ? false |
|
428 |
||
429 |
"Created: / 04-10-2006 / 13:06:57 / cg" |
|
430 |
! |
|
431 |
||
432 |
showTimestamp:aBoolean |
|
433 |
showTimestamp := aBoolean. |
|
434 |
||
435 |
"Created: / 04-10-2006 / 13:07:02 / cg" |
|
6520 | 436 |
! ! |
437 |
||
438 |
!EventMonitor::EventMonitorView methodsFor:'drawing'! |
|
439 |
||
440 |
redraw |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
441 |
|y p lines font| |
6520 | 442 |
|
443 |
self clear. |
|
444 |
lines := labelHolder value asCollectionOfLines. |
|
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
445 |
font := gc font. |
6520 | 446 |
|
447 |
y := (self height - ((font heightOf:'A') * lines size)) // 2. |
|
448 |
lines do:[:eachLine | |
|
14149 | 449 |
p := (self center x - ((font widthOf:eachLine) // 2)) @ y. |
450 |
self displayString:eachLine value x:(p x) y:(p y). |
|
451 |
y := y + (font heightOf:eachLine). |
|
6520 | 452 |
] |
7354 | 453 |
! |
454 |
||
455 |
showEventTime |
|
456 |
self showTimestamp ifTrue:[ |
|
14149 | 457 |
Transcript show:(Timestamp now); show:' '. |
7354 | 458 |
] |
459 |
||
460 |
"Created: / 04-10-2006 / 13:08:27 / cg" |
|
6520 | 461 |
! ! |
462 |
||
463 |
!EventMonitor::EventMonitorView methodsFor:'events'! |
|
19 | 464 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
465 |
buttonMotion:state x:x y:y |
6582 | 466 |
self showButtonMotion ifFalse:[^ self]. |
467 |
||
7354 | 468 |
self showEventTime. |
6520 | 469 |
outputStream nextPutAll:'buttonMotion x:'. |
470 |
x printOn:outputStream. |
|
471 |
outputStream nextPutAll:' y:'. |
|
472 |
y printOn:outputStream. |
|
473 |
outputStream nextPutAll:' state:'. |
|
474 |
state printOn:outputStream. |
|
475 |
outputStream cr. |
|
1117 | 476 |
|
7354 | 477 |
"Modified: / 04-10-2006 / 13:07:53 / cg" |
19 | 478 |
! |
479 |
||
2159 | 480 |
buttonMultiPress:button x:x y:y |
7354 | 481 |
self showEventTime. |
482 |
||
6520 | 483 |
outputStream nextPutAll:'buttonMultiPress x:'. |
484 |
x printOn:outputStream. |
|
485 |
outputStream nextPutAll:' y:'. |
|
486 |
y printOn:outputStream. |
|
487 |
outputStream nextPutAll:' button:'. |
|
488 |
button printOn:outputStream. |
|
489 |
outputStream cr. |
|
2159 | 490 |
|
7354 | 491 |
"Created: / 19-05-1999 / 09:40:40 / cg" |
492 |
"Modified: / 04-10-2006 / 13:08:36 / cg" |
|
2159 | 493 |
! |
494 |
||
19 | 495 |
buttonPress:button x:x y:y |
18585 | 496 |
|sensor| |
497 |
||
7354 | 498 |
self showEventTime. |
499 |
||
6520 | 500 |
outputStream nextPutAll:'buttonPress x:'. |
501 |
x printOn:outputStream. |
|
502 |
outputStream nextPutAll:' y:'. |
|
503 |
y printOn:outputStream. |
|
504 |
outputStream nextPutAll:' button:'. |
|
505 |
button printOn:outputStream. |
|
18585 | 506 |
|
507 |
sensor := self sensor. |
|
508 |
sensor shiftDown ifTrue:[ |
|
17383 | 509 |
outputStream nextPutAll:' +shift'. |
510 |
]. |
|
18585 | 511 |
sensor ctrlDown ifTrue:[ |
17383 | 512 |
outputStream nextPutAll:' +ctrl'. |
513 |
]. |
|
18585 | 514 |
sensor altDown ifTrue:[ |
17383 | 515 |
outputStream nextPutAll:' +alt'. |
516 |
]. |
|
18585 | 517 |
sensor metaDown ifTrue:[ |
17383 | 518 |
outputStream nextPutAll:' +meta'. |
519 |
]. |
|
6520 | 520 |
outputStream cr. |
521 |
outputStream flush. |
|
1117 | 522 |
|
17383 | 523 |
"Modified: / 10-02-2017 / 21:21:48 / cg" |
18585 | 524 |
"Modified: / 13-02-2019 / 12:51:51 / Claus Gittinger" |
19 | 525 |
! |
526 |
||
527 |
buttonRelease:button x:x y:y |
|
7354 | 528 |
self showEventTime. |
529 |
||
6520 | 530 |
outputStream nextPutAll:'buttonRelease x:'. |
531 |
x printOn:outputStream. |
|
532 |
outputStream nextPutAll:' y:'. |
|
533 |
y printOn:outputStream. |
|
534 |
outputStream nextPutAll:' button:'. |
|
535 |
button printOn:outputStream. |
|
536 |
outputStream cr. |
|
1117 | 537 |
|
7354 | 538 |
"Modified: / 04-10-2006 / 13:08:46 / cg" |
19 | 539 |
! |
540 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
541 |
configureX:x y:y width:newWidth height:newHeight |
7354 | 542 |
self showEventTime. |
543 |
||
6520 | 544 |
outputStream nextPutAll:'configure x:'. |
545 |
x printOn:outputStream. |
|
546 |
outputStream nextPutAll:' y:'. |
|
547 |
y printOn:outputStream. |
|
548 |
outputStream nextPutAll:' width:'. |
|
549 |
newWidth printOn:outputStream. |
|
550 |
outputStream nextPutAll:' height:'. |
|
551 |
newHeight printOn:outputStream. |
|
552 |
outputStream nextPutAll:' button:'. |
|
553 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
554 |
|
6520 | 555 |
super configureX:x y:y width:newWidth height:newHeight. |
556 |
||
557 |
self invalidate. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
558 |
|
7354 | 559 |
"Modified: / 04-10-2006 / 13:08:49 / cg" |
1117 | 560 |
! |
561 |
||
8583
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
562 |
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
|
563 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
564 |
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
|
565 |
|
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
566 |
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
|
567 |
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
|
568 |
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
|
569 |
! |
1ba96eea53a8
Menu for ModalBox (in order to genrate coveredBy: events, which are not received)
Stefan Vogel <sv@exept.de>
parents:
8089
diff
changeset
|
570 |
|
7320 | 571 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
572 |
event isButtonMotionEvent ifTrue:[ |
|
14149 | 573 |
self showButtonMotion ifFalse:[^ self]. |
7320 | 574 |
]. |
575 |
||
576 |
"/ Timestamp now printOn:outputStream. |
|
577 |
"/ outputStream nextPutAll:' '. |
|
578 |
||
579 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate. |
|
580 |
||
581 |
"Created: / 20-09-2006 / 10:29:38 / cg" |
|
582 |
! |
|
583 |
||
1117 | 584 |
dropMessage:dropType data:dropData |
7354 | 585 |
self showEventTime. |
586 |
||
6520 | 587 |
outputStream nextPutAll:'drop '. |
588 |
dropType printOn:outputStream. |
|
589 |
outputStream nextPutAll:' data:'. |
|
590 |
dropData printOn:outputStream. |
|
591 |
outputStream cr. |
|
1117 | 592 |
|
7354 | 593 |
"Modified: / 04-10-2006 / 13:09:13 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
594 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
595 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
596 |
focusIn |
7353 | 597 |
self showFocusEvents ifFalse:[^ self]. |
598 |
||
7354 | 599 |
self showEventTime. |
600 |
||
6520 | 601 |
outputStream nextPutLine:'focusIn '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
602 |
|
7353 | 603 |
"Created: / 07-03-1996 / 15:06:18 / cg" |
7354 | 604 |
"Modified: / 04-10-2006 / 13:09:17 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
605 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
606 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
607 |
focusOut |
7353 | 608 |
self showFocusEvents ifFalse:[^ self]. |
609 |
||
7354 | 610 |
self showEventTime. |
611 |
||
6520 | 612 |
outputStream nextPutLine:'focusOut '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
613 |
|
7353 | 614 |
"Created: / 07-03-1996 / 15:06:21 / cg" |
7354 | 615 |
"Modified: / 04-10-2006 / 13:09:20 / cg" |
433
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 |
|
2159 | 618 |
hasKeyboardFocus:aBoolen |
7353 | 619 |
self showFocusEvents ifFalse:[^ self]. |
620 |
||
7354 | 621 |
self showEventTime. |
622 |
||
6520 | 623 |
outputStream nextPutAll:'hasKeyboardFocus:'. |
624 |
aBoolen printOn:outputStream. |
|
625 |
outputStream cr. |
|
2159 | 626 |
|
7354 | 627 |
"Modified: / 04-10-2006 / 13:09:23 / cg" |
2159 | 628 |
! |
629 |
||
19253 | 630 |
key:key what:pressOrRelease x:x y:y |
631 |
|rawKey untranslatedKey| |
|
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
632 |
|
7354 | 633 |
self showEventTime. |
634 |
||
19253 | 635 |
pressOrRelease printOn:outputStream. |
636 |
' x:' printOn:outputStream. x printOn:outputStream. |
|
637 |
' y:' printOn:outputStream. y printOn:outputStream. |
|
6344 | 638 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
639 |
(key isMemberOf:Character) ifTrue:[ |
19253 | 640 |
key codePoint <= 16rFF ifTrue:[ |
641 |
' characterKey:' printOn:outputStream. key storeString printOn:outputStream. |
|
642 |
] ifFalse:[ |
|
643 |
' utf8:' printOn:outputStream. key asString utf8Encoded asByteArray hexPrintOn:outputStream. |
|
644 |
]. |
|
645 |
' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
646 |
] ifFalse:[ |
19253 | 647 |
' symbolicKey:' printOn:outputStream. key storeString printOn:outputStream. |
16250 | 648 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
14149 | 649 |
untranslatedKey ~~ key ifTrue:[ |
19253 | 650 |
' untranslatedKey:' printOn:outputStream. untranslatedKey storeString printOn:outputStream |
14149 | 651 |
]. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
652 |
]. |
18328 | 653 |
rawKey := (WindowGroup lastEvent) rawKey. |
19253 | 654 |
' rawKey:' printOn:outputStream. rawKey storeString printOn:outputStream. |
7354 | 655 |
|
656 |
key isCharacter ifTrue:[ |
|
14149 | 657 |
outputStream nextPutAll:' '''. |
658 |
key asString printOn:outputStream. |
|
659 |
outputStream nextPutAll:''''. |
|
7354 | 660 |
]. |
19297 | 661 |
Display leftShiftDown ifTrue:[outputStream nextPutAll:' [leftShift]']. |
662 |
Display rightShiftDown ifTrue:[outputStream nextPutAll:' [rightShift]']. |
|
663 |
Display leftCtrlDown ifTrue:[outputStream nextPutAll:' [leftCtrl]']. |
|
664 |
Display rightCtrlDown ifTrue:[outputStream nextPutAll:' [rightCtrl]']. |
|
665 |
||
6520 | 666 |
outputStream cr. |
7354 | 667 |
|
668 |
"Modified: / 04-10-2006 / 13:12:07 / cg" |
|
18328 | 669 |
"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
|
670 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
671 |
|
19253 | 672 |
keyPress:key x:x y:y |
673 |
self key:key what:'KeyPress' x:x y:y |
|
674 |
! |
|
6520 | 675 |
|
19253 | 676 |
keyRelease:key x:x y:y |
677 |
self key:key what:'KeyRelease' x:x y:y |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
678 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
679 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
680 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
681 |
mapped |
7354 | 682 |
self showEventTime. |
683 |
||
6520 | 684 |
outputStream nextPutLine:'mapped '. |
685 |
||
1977 | 686 |
super mapped. |
1117 | 687 |
|
7354 | 688 |
"Modified: / 04-10-2006 / 13:09:31 / cg" |
45 | 689 |
! |
690 |
||
52 | 691 |
pointerEnter:state x:x y:y |
19255 | 692 |
self showPointerEvents ifFalse:[^ self]. |
693 |
||
7354 | 694 |
self showEventTime. |
695 |
||
6520 | 696 |
outputStream nextPutAll:'pointerEnter x:'. |
697 |
x printOn:outputStream. |
|
698 |
outputStream nextPutAll:' y:'. |
|
699 |
y printOn:outputStream. |
|
700 |
outputStream nextPutAll:' state:'. |
|
701 |
state printOn:outputStream. |
|
702 |
outputStream cr. |
|
1117 | 703 |
|
7354 | 704 |
"Modified: / 04-10-2006 / 13:09:34 / cg" |
52 | 705 |
! |
706 |
||
14148
5e6a841c980f
access font via message send to gc
Stefan Vogel <sv@exept.de>
parents:
8583
diff
changeset
|
707 |
pointerLeave:state |
19255 | 708 |
self showPointerEvents ifFalse:[^ self]. |
709 |
||
7354 | 710 |
self showEventTime. |
711 |
||
6520 | 712 |
outputStream nextPutAll:'pointerLeave state:'. |
713 |
state storeString printOn:outputStream. |
|
714 |
outputStream cr. |
|
1117 | 715 |
|
7354 | 716 |
"Modified: / 04-10-2006 / 13:09:36 / cg" |
52 | 717 |
! |
718 |
||
19253 | 719 |
printKeyInfoFor:key x:x y:y |
720 |
|s rawKey untranslatedKey| |
|
721 |
||
722 |
self showEventTime. |
|
723 |
||
724 |
' x:' printOn:outputStream. x printOn:outputStream. |
|
725 |
' y:' printOn:outputStream. y printOn:outputStream. |
|
726 |
||
727 |
(key isMemberOf:Character) ifTrue:[ |
|
728 |
s := ' characterKey:' , key storeString |
|
729 |
, ' (' , key asciiValue printString , ')'. |
|
730 |
] ifFalse:[ |
|
731 |
s := ' symbolicKey:' , key storeString. |
|
732 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
|
733 |
untranslatedKey ~~ key ifTrue:[ |
|
734 |
s := s , ' untranslatedKey:' , untranslatedKey storeString |
|
735 |
]. |
|
736 |
]. |
|
737 |
rawKey := (WindowGroup lastEvent) rawKey. |
|
738 |
' rawKey:' printOn:outputStream. rawKey storeString printOn:outputStream. |
|
739 |
||
740 |
key isCharacter ifTrue:[ |
|
741 |
outputStream nextPutAll:' '''. |
|
742 |
key asString printOn:outputStream. |
|
743 |
outputStream nextPutAll:''''. |
|
744 |
]. |
|
745 |
outputStream cr. |
|
746 |
||
747 |
"Modified: / 04-10-2006 / 13:12:07 / cg" |
|
748 |
"Modified: / 09-08-2018 / 10:31:33 / Claus Gittinger" |
|
749 |
! |
|
750 |
||
6582 | 751 |
sizeChanged:how |
8089 | 752 |
outputStream nextPutAll:'sizeChanged how:'. |
753 |
how printOn:outputStream. |
|
754 |
outputStream cr. |
|
755 |
||
6582 | 756 |
super sizeChanged:how. |
757 |
self invalidate |
|
7354 | 758 |
|
759 |
"Modified: / 04-10-2006 / 13:17:46 / cg" |
|
6582 | 760 |
! |
761 |
||
45 | 762 |
unmapped |
7354 | 763 |
self showEventTime. |
764 |
||
6520 | 765 |
outputStream nextPutLine:'unmapped '. |
766 |
||
1977 | 767 |
super unmapped. |
1117 | 768 |
|
7354 | 769 |
"Modified: / 04-10-2006 / 13:09:41 / cg" |
45 | 770 |
! |
771 |
||
772 |
visibilityChange:how |
|
7354 | 773 |
self showEventTime. |
774 |
||
6520 | 775 |
outputStream nextPutAll:'visibilityChange:'. |
776 |
how storeString printOn:outputStream. |
|
777 |
outputStream cr. |
|
778 |
||
1977 | 779 |
super visibilityChange:how |
1117 | 780 |
|
7354 | 781 |
"Modified: / 04-10-2006 / 13:09:43 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
782 |
! ! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
783 |
|
6520 | 784 |
!EventMonitor::EventMonitorView methodsFor:'initialization'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
785 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
786 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
787 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
788 |
|
6520 | 789 |
labelHolder := '' asValue. |
790 |
self outputStream:Stdout. |
|
19 | 791 |
! ! |
792 |
||
6520 | 793 |
!EventMonitor::EventMonitorView methodsFor:'realization'! |
19 | 794 |
|
795 |
initEvents |
|
796 |
self enableMotionEvents. |
|
45 | 797 |
self enableKeyReleaseEvents. |
52 | 798 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
799 |
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
|
800 |
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
|
801 |
"/ 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
|
802 |
"/ self enableEvent:#substructureNotify. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
803 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
804 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 805 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
806 |
|
1021 | 807 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
808 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
809 |
version |
16250 | 810 |
^ '$Header$' |
18586 | 811 |
! |
812 |
||
813 |
version_CVS |
|
814 |
^ '$Header$' |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
815 |
! ! |
14149 | 816 |