author | Claus Gittinger <cg@exept.de> |
Wed, 20 Sep 2006 10:30:48 +0200 | |
changeset 7320 | 049c5c2a8642 |
parent 6759 | 72791b0658d6 |
child 7353 | 1774c44279dd |
permissions | -rw-r--r-- |
52 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
2805 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
6520 | 15 |
ApplicationModel subclass:#EventMonitor |
16 |
instanceVariableNames:'outputSelector' |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
17 |
classVariableNames:'' |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
18 |
poolDictionaries:'' |
1053 | 19 |
category:'Monitors-ST/X' |
19 | 20 |
! |
21 |
||
6520 | 22 |
View subclass:#EventMonitorView |
6582 | 23 |
instanceVariableNames:'outputStream labelHolder showButtonMotion' |
6520 | 24 |
classVariableNames:'' |
25 |
poolDictionaries:'' |
|
26 |
privateIn:EventMonitor |
|
27 |
! |
|
28 |
||
1021 | 29 |
!EventMonitor class methodsFor:'documentation'! |
52 | 30 |
|
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
34 |
All Rights Reserved |
|
19 | 35 |
|
52 | 36 |
This software is furnished under a license and may be used |
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
! |
|
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
like xev - show events. |
|
6520 | 48 |
|
52 | 49 |
You can use this to check your keyboard mappings, for example. |
50 |
start with: |
|
6520 | 51 |
EventMonitor open |
52 |
and watch the output on the xterm/console. |
|
52 | 53 |
" |
54 |
! ! |
|
19 | 55 |
|
1021 | 56 |
!EventMonitor class methodsFor:'defaults'! |
19 | 57 |
|
58 |
defaultExtent |
|
59 |
^ 200 @ 200 |
|
60 |
! |
|
61 |
||
62 |
defaultLabel |
|
63 |
^ 'Event Monitor' |
|
64 |
! ! |
|
65 |
||
6520 | 66 |
!EventMonitor class methodsFor:'interface specs'! |
67 |
||
68 |
windowSpec |
|
69 |
"This resource specification was automatically generated |
|
70 |
by the UIPainter of ST/X." |
|
71 |
||
72 |
"Do not manually edit this!! If it is corrupted, |
|
73 |
the UIPainter may not be able to read the specification." |
|
74 |
||
75 |
" |
|
76 |
UIPainter new openOnClass:EventMonitor andSelector:#windowSpec |
|
77 |
EventMonitor new openInterface:#windowSpec |
|
78 |
EventMonitor open |
|
79 |
" |
|
80 |
||
81 |
<resource: #canvas> |
|
82 |
||
83 |
^ |
|
84 |
#(FullSpec |
|
85 |
name: windowSpec |
|
86 |
window: |
|
87 |
(WindowSpec |
|
88 |
label: 'EventMonitor' |
|
89 |
name: 'EventMonitor' |
|
90 |
min: (Point 10 10) |
|
91 |
max: (Point 1024 768) |
|
92 |
bounds: (Rectangle 0 0 300 300) |
|
93 |
menu: mainMenu |
|
94 |
) |
|
95 |
component: |
|
96 |
(SpecCollection |
|
97 |
collection: ( |
|
98 |
(NonScrollableArbitraryComponentSpec |
|
99 |
name: 'eventMonitorView' |
|
100 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
101 |
component: EventMonitorView |
|
102 |
) |
|
103 |
) |
|
104 |
||
105 |
) |
|
106 |
) |
|
107 |
! ! |
|
108 |
||
109 |
!EventMonitor class methodsFor:'menu specs'! |
|
110 |
||
111 |
mainMenu |
|
112 |
"This resource specification was automatically generated |
|
113 |
by the MenuEditor of ST/X." |
|
114 |
||
115 |
"Do not manually edit this!! If it is corrupted, |
|
116 |
the MenuEditor may not be able to read the specification." |
|
117 |
||
118 |
" |
|
119 |
MenuEditor new openOnClass:EventMonitor andSelector:#mainMenu |
|
120 |
(Menu new fromLiteralArrayEncoding:(EventMonitor mainMenu)) startUp |
|
121 |
" |
|
122 |
||
123 |
<resource: #menu> |
|
124 |
||
125 |
^ |
|
126 |
#(Menu |
|
127 |
( |
|
128 |
(MenuItem |
|
129 |
label: 'File' |
|
130 |
translateLabel: true |
|
131 |
submenu: |
|
132 |
(Menu |
|
133 |
( |
|
134 |
(MenuItem |
|
135 |
label: 'Exit' |
|
136 |
itemValue: closeRequest |
|
137 |
translateLabel: true |
|
138 |
) |
|
139 |
) |
|
140 |
nil |
|
141 |
nil |
|
142 |
) |
|
143 |
) |
|
144 |
(MenuItem |
|
6582 | 145 |
label: 'Filter' |
146 |
translateLabel: true |
|
147 |
submenu: |
|
148 |
(Menu |
|
149 |
( |
|
150 |
(MenuItem |
|
151 |
label: 'Show ButtonMotion' |
|
152 |
itemValue: showButtonMotion: |
|
153 |
translateLabel: true |
|
154 |
indication: showButtonMotion |
|
155 |
) |
|
156 |
) |
|
157 |
nil |
|
158 |
nil |
|
159 |
) |
|
160 |
) |
|
161 |
(MenuItem |
|
6520 | 162 |
label: 'Output' |
163 |
translateLabel: true |
|
164 |
submenu: |
|
165 |
(Menu |
|
166 |
( |
|
167 |
(MenuItem |
|
168 |
label: 'Stdout' |
|
169 |
translateLabel: true |
|
170 |
choice: outputSelector |
|
171 |
choiceValue: stdout |
|
172 |
) |
|
173 |
(MenuItem |
|
174 |
label: 'Transcript' |
|
175 |
translateLabel: true |
|
176 |
choice: outputSelector |
|
177 |
choiceValue: transcript |
|
178 |
) |
|
179 |
) |
|
180 |
nil |
|
181 |
nil |
|
182 |
) |
|
183 |
) |
|
184 |
(MenuItem |
|
185 |
label: 'Help' |
|
186 |
translateLabel: true |
|
187 |
startGroup: right |
|
188 |
submenu: |
|
189 |
(Menu |
|
190 |
( |
|
191 |
(MenuItem |
|
192 |
label: 'Documentation' |
|
193 |
itemValue: openDocumentation |
|
194 |
translateLabel: true |
|
195 |
) |
|
196 |
(MenuItem |
|
197 |
label: '-' |
|
198 |
) |
|
199 |
(MenuItem |
|
200 |
label: 'About this Application' |
|
201 |
itemValue: openAboutThisApplication |
|
202 |
translateLabel: true |
|
203 |
) |
|
204 |
) |
|
205 |
nil |
|
206 |
nil |
|
207 |
) |
|
208 |
) |
|
209 |
) |
|
210 |
nil |
|
211 |
nil |
|
212 |
) |
|
213 |
! ! |
|
214 |
||
215 |
!EventMonitor methodsFor:'aspects'! |
|
216 |
||
6582 | 217 |
eventMonitorView |
218 |
^ (self builder componentAt:#eventMonitorView) |
|
219 |
! |
|
220 |
||
6520 | 221 |
outputSelector |
222 |
outputSelector isNil ifTrue:[ |
|
6759
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
223 |
outputSelector := #transcript asValue. |
6520 | 224 |
outputSelector onChangeEvaluate:[ self outputSelectorChanged ]. |
225 |
]. |
|
226 |
^ outputSelector |
|
227 |
! |
|
228 |
||
229 |
outputSelectorChanged |
|
230 |
|stream| |
|
231 |
||
232 |
stream := self outputSelector value == #transcript ifTrue:[Transcript] ifFalse:[Stdout]. |
|
6582 | 233 |
self eventMonitorView outputStream:stream. |
234 |
! |
|
235 |
||
6759
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
236 |
postBuildWith:aBuilder |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
237 |
super postBuildWith:aBuilder. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
238 |
self outputSelectorChanged. |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
239 |
! |
72791b0658d6
start initially with Transcript as output
Claus Gittinger <cg@exept.de>
parents:
6582
diff
changeset
|
240 |
|
6582 | 241 |
showButtonMotion |
242 |
^ self eventMonitorView showButtonMotion |
|
243 |
! |
|
244 |
||
245 |
showButtonMotion:aBoolean |
|
246 |
^ self eventMonitorView showButtonMotion:aBoolean |
|
6520 | 247 |
! ! |
248 |
||
249 |
!EventMonitor methodsFor:'menu actions'! |
|
250 |
||
251 |
openAboutThisApplication |
|
252 |
"This method was generated by the Browser. |
|
253 |
It will be invoked when the menu-item 'help-about' is selected." |
|
254 |
||
255 |
"/ could open a customized aboutBox here ... |
|
256 |
super openAboutThisApplication |
|
257 |
! |
|
258 |
||
259 |
openDocumentation |
|
260 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#EVENTMONITOR'. |
|
261 |
! ! |
|
262 |
||
263 |
!EventMonitor::EventMonitorView class methodsFor:'defaults'! |
|
264 |
||
265 |
defaultExtent |
|
266 |
^ 200 @ 200 |
|
267 |
! |
|
268 |
||
269 |
defaultLabel |
|
270 |
^ 'Event Monitor' |
|
271 |
! ! |
|
272 |
||
273 |
!EventMonitor::EventMonitorView class methodsFor:'documentation'! |
|
274 |
||
275 |
documentation |
|
276 |
" |
|
277 |
like xev - show events. |
|
278 |
You can use this to check your keyboard mappings, for example. |
|
279 |
start with: |
|
280 |
EventMonitorView open |
|
281 |
and watch the output on xterm. |
|
282 |
" |
|
283 |
! ! |
|
284 |
||
285 |
!EventMonitor::EventMonitorView class methodsFor:'startup'! |
|
1822 | 286 |
|
287 |
isVisualStartable |
|
288 |
^ true |
|
289 |
||
290 |
"Created: / 10.8.1998 / 16:03:13 / cg" |
|
291 |
! ! |
|
292 |
||
6520 | 293 |
!EventMonitor::EventMonitorView methodsFor:'accessing'! |
294 |
||
295 |
outputStream:something |
|
296 |
outputStream := something. |
|
297 |
||
298 |
labelHolder value:nil. |
|
299 |
outputStream == Stdout ifTrue:[ |
|
300 |
labelHolder value: 'See event trace\on the standard output' withCRs. |
|
301 |
]. |
|
302 |
outputStream == Transcript ifTrue:[ |
|
303 |
labelHolder value: 'See event trace\on the Transcript' withCRs. |
|
304 |
]. |
|
6582 | 305 |
self invalidate. |
306 |
! |
|
307 |
||
308 |
showButtonMotion |
|
309 |
^ showButtonMotion ? true |
|
310 |
! |
|
311 |
||
312 |
showButtonMotion:something |
|
313 |
showButtonMotion := something. |
|
6520 | 314 |
! ! |
315 |
||
316 |
!EventMonitor::EventMonitorView methodsFor:'drawing'! |
|
317 |
||
318 |
redraw |
|
319 |
|y p lines| |
|
320 |
||
321 |
self clear. |
|
322 |
lines := labelHolder value asCollectionOfLines. |
|
323 |
||
324 |
y := (self height - ((font heightOf:'A') * lines size)) // 2. |
|
325 |
lines do:[:eachLine | |
|
326 |
p := (self center x - ((font widthOf:eachLine) // 2)) @ y. |
|
327 |
self displayString:eachLine value x:(p x) y:(p y). |
|
328 |
y := y + (font heightOf:eachLine). |
|
329 |
] |
|
330 |
! ! |
|
331 |
||
332 |
!EventMonitor::EventMonitorView methodsFor:'events'! |
|
19 | 333 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
334 |
buttonMotion:state x:x y:y |
6582 | 335 |
self showButtonMotion ifFalse:[^ self]. |
336 |
||
6520 | 337 |
outputStream nextPutAll:'buttonMotion x:'. |
338 |
x printOn:outputStream. |
|
339 |
outputStream nextPutAll:' y:'. |
|
340 |
y printOn:outputStream. |
|
341 |
outputStream nextPutAll:' state:'. |
|
342 |
state printOn:outputStream. |
|
343 |
outputStream cr. |
|
1117 | 344 |
|
7320 | 345 |
"Modified: / 20-09-2006 / 10:29:50 / cg" |
19 | 346 |
! |
347 |
||
2159 | 348 |
buttonMultiPress:button x:x y:y |
6520 | 349 |
outputStream nextPutAll:'buttonMultiPress x:'. |
350 |
x printOn:outputStream. |
|
351 |
outputStream nextPutAll:' y:'. |
|
352 |
y printOn:outputStream. |
|
353 |
outputStream nextPutAll:' button:'. |
|
354 |
button printOn:outputStream. |
|
355 |
outputStream cr. |
|
2159 | 356 |
|
357 |
"Modified: / 5.4.1997 / 01:23:42 / cg" |
|
358 |
"Created: / 19.5.1999 / 09:40:40 / cg" |
|
359 |
! |
|
360 |
||
19 | 361 |
buttonPress:button x:x y:y |
6520 | 362 |
outputStream nextPutAll:'buttonPress x:'. |
363 |
x printOn:outputStream. |
|
364 |
outputStream nextPutAll:' y:'. |
|
365 |
y printOn:outputStream. |
|
366 |
outputStream nextPutAll:' button:'. |
|
367 |
button printOn:outputStream. |
|
368 |
outputStream cr. |
|
369 |
outputStream flush. |
|
1117 | 370 |
|
7320 | 371 |
"Modified: / 20-09-2006 / 10:29:43 / cg" |
19 | 372 |
! |
373 |
||
374 |
buttonRelease:button x:x y:y |
|
6520 | 375 |
outputStream nextPutAll:'buttonRelease x:'. |
376 |
x printOn:outputStream. |
|
377 |
outputStream nextPutAll:' y:'. |
|
378 |
y printOn:outputStream. |
|
379 |
outputStream nextPutAll:' button:'. |
|
380 |
button printOn:outputStream. |
|
381 |
outputStream cr. |
|
1117 | 382 |
|
383 |
"Modified: 5.4.1997 / 01:23:43 / cg" |
|
19 | 384 |
! |
385 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
386 |
configureX:x y:y width:newWidth height:newHeight |
6520 | 387 |
outputStream nextPutAll:'configure x:'. |
388 |
x printOn:outputStream. |
|
389 |
outputStream nextPutAll:' y:'. |
|
390 |
y printOn:outputStream. |
|
391 |
outputStream nextPutAll:' width:'. |
|
392 |
newWidth printOn:outputStream. |
|
393 |
outputStream nextPutAll:' height:'. |
|
394 |
newHeight printOn:outputStream. |
|
395 |
outputStream nextPutAll:' button:'. |
|
396 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
397 |
|
6520 | 398 |
super configureX:x y:y width:newWidth height:newHeight. |
399 |
||
400 |
self invalidate. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
401 |
|
1117 | 402 |
"Modified: 5.4.1997 / 01:23:45 / cg" |
403 |
! |
|
404 |
||
7320 | 405 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate |
406 |
event isButtonMotionEvent ifTrue:[ |
|
407 |
self showButtonMotion ifFalse:[^ self]. |
|
408 |
]. |
|
409 |
||
410 |
"/ Timestamp now printOn:outputStream. |
|
411 |
"/ outputStream nextPutAll:' '. |
|
412 |
||
413 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate. |
|
414 |
||
415 |
"Created: / 20-09-2006 / 10:29:38 / cg" |
|
416 |
! |
|
417 |
||
1117 | 418 |
dropMessage:dropType data:dropData |
6520 | 419 |
outputStream nextPutAll:'drop '. |
420 |
dropType printOn:outputStream. |
|
421 |
outputStream nextPutAll:' data:'. |
|
422 |
dropData printOn:outputStream. |
|
423 |
outputStream cr. |
|
1117 | 424 |
|
425 |
"Modified: 5.4.1997 / 01:23:28 / cg" |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
426 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
427 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
428 |
focusIn |
6520 | 429 |
outputStream nextPutLine:'focusIn '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
430 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
431 |
"Created: 7.3.1996 / 15:06:18 / cg" |
1117 | 432 |
"Modified: 5.4.1997 / 01:23:48 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
433 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
434 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
435 |
focusOut |
6520 | 436 |
outputStream nextPutLine:'focusOut '. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
437 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
438 |
"Created: 7.3.1996 / 15:06:21 / cg" |
1117 | 439 |
"Modified: 5.4.1997 / 01:23:49 / cg" |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
440 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
441 |
|
2159 | 442 |
hasKeyboardFocus:aBoolen |
6520 | 443 |
outputStream nextPutAll:'hasKeyboardFocus:'. |
444 |
aBoolen printOn:outputStream. |
|
445 |
outputStream cr. |
|
2159 | 446 |
|
447 |
"Modified: / 19.5.1999 / 09:42:59 / cg" |
|
448 |
! |
|
449 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
450 |
keyPress:key x:x y:y |
6344 | 451 |
|s rawKey untranslatedKey| |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
452 |
|
2805 | 453 |
s := 'KeyPress x:' , x printString , ' y:' , y printString. |
6520 | 454 |
s printOn:outputStream. |
6344 | 455 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
456 |
(key isMemberOf:Character) ifTrue:[ |
6582 | 457 |
s := ' character key:' , key storeString |
2805 | 458 |
, ' (' , key asciiValue printString , ')'. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
459 |
] ifFalse:[ |
2805 | 460 |
s := ' symbolic key:' , key storeString. |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
461 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
462 |
untranslatedKey ~~ key ifTrue:[ |
6582 | 463 |
s := s , ' untranslated key:' , untranslatedKey storeString |
2805 | 464 |
]. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
465 |
]. |
6344 | 466 |
rawKey := (WindowGroup lastEventQuerySignal query) rawKey. |
6582 | 467 |
s := s , ' rawKey:' , rawKey storeString. |
6344 | 468 |
|
6520 | 469 |
s printOn:outputStream. |
470 |
outputStream cr. |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
471 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
472 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
473 |
keyRelease:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
474 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
475 |
|
6520 | 476 |
'KeyRelease x:' printOn:outputStream. |
477 |
x printOn:outputStream. |
|
478 |
' y:' printOn:outputStream. |
|
479 |
y printOn:outputStream. |
|
480 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
481 |
(key isMemberOf:Character) ifTrue:[ |
6187 | 482 |
key codePoint <= 16rFF ifTrue:[ |
6520 | 483 |
' character key:' printOn:outputStream. |
6582 | 484 |
key storeString printOn:outputStream. |
6187 | 485 |
] ifFalse:[ |
6520 | 486 |
' unicode character utf8:' printOn:outputStream. |
487 |
key asString utf8Encoded asByteArray hexPrintOn:outputStream. |
|
6187 | 488 |
]. |
6520 | 489 |
' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
490 |
] ifFalse:[ |
6582 | 491 |
' symbolic key:' print. key storeString printOn:outputStream. |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
492 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
493 |
untranslatedKey ~~ key ifTrue:[ |
6582 | 494 |
' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
495 |
] |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
496 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
497 |
|
6520 | 498 |
outputStream cr |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
499 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
500 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
501 |
mapped |
6520 | 502 |
outputStream nextPutLine:'mapped '. |
503 |
||
1977 | 504 |
super mapped. |
1117 | 505 |
|
1977 | 506 |
"Modified: / 6.1.1999 / 11:04:32 / cg" |
45 | 507 |
! |
508 |
||
52 | 509 |
pointerEnter:state x:x y:y |
6520 | 510 |
outputStream nextPutAll:'pointerEnter x:'. |
511 |
x printOn:outputStream. |
|
512 |
outputStream nextPutAll:' y:'. |
|
513 |
y printOn:outputStream. |
|
514 |
outputStream nextPutAll:' state:'. |
|
515 |
state printOn:outputStream. |
|
516 |
outputStream cr. |
|
1117 | 517 |
|
518 |
"Modified: 5.4.1997 / 01:24:02 / cg" |
|
52 | 519 |
! |
520 |
||
521 |
pointerLeave:state |
|
6520 | 522 |
outputStream nextPutAll:'pointerLeave state:'. |
523 |
state storeString printOn:outputStream. |
|
524 |
outputStream cr. |
|
1117 | 525 |
|
526 |
"Modified: 5.4.1997 / 01:24:05 / cg" |
|
52 | 527 |
! |
528 |
||
6582 | 529 |
sizeChanged:how |
530 |
super sizeChanged:how. |
|
531 |
self invalidate |
|
532 |
! |
|
533 |
||
45 | 534 |
unmapped |
6520 | 535 |
outputStream nextPutLine:'unmapped '. |
536 |
||
1977 | 537 |
super unmapped. |
1117 | 538 |
|
1977 | 539 |
"Modified: / 6.1.1999 / 11:04:22 / cg" |
45 | 540 |
! |
541 |
||
542 |
visibilityChange:how |
|
6520 | 543 |
outputStream nextPutAll:'visibilityChange:'. |
544 |
how storeString printOn:outputStream. |
|
545 |
outputStream cr. |
|
546 |
||
1977 | 547 |
super visibilityChange:how |
1117 | 548 |
|
1977 | 549 |
"Modified: / 6.1.1999 / 11:04:12 / 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 |
|
6520 | 552 |
!EventMonitor::EventMonitorView methodsFor:'initialization'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
553 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
554 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
555 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
556 |
|
6520 | 557 |
labelHolder := '' asValue. |
558 |
self outputStream:Stdout. |
|
19 | 559 |
! ! |
560 |
||
6520 | 561 |
!EventMonitor::EventMonitorView methodsFor:'realization'! |
19 | 562 |
|
563 |
initEvents |
|
564 |
self enableMotionEvents. |
|
45 | 565 |
self enableKeyReleaseEvents. |
52 | 566 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
567 |
self enableFocusEvents. |
45 | 568 |
self enableEvent:#visibilityChange |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
569 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
570 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 571 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
572 |
|
1021 | 573 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
574 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
575 |
version |
7320 | 576 |
^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.26 2006-09-20 08:30:48 cg Exp $' |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
577 |
! ! |