author | Claus Gittinger <cg@exept.de> |
Sun, 02 Mar 1997 11:21:18 +0100 | |
changeset 1052 | 81d87e3e1d14 |
parent 1021 | 31349a9be7ac |
child 1053 | 9b1b15ef1e34 |
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 |
||
19 | 13 |
StandardSystemView subclass:#EventMonitor |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
14 |
instanceVariableNames:'' |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
15 |
classVariableNames:'' |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
16 |
poolDictionaries:'' |
1052 | 17 |
category:'Monitors-Status-ST/X' |
19 | 18 |
! |
19 |
||
1021 | 20 |
!EventMonitor class methodsFor:'documentation'! |
52 | 21 |
|
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
19 | 26 |
|
52 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
like xev - show events. |
|
39 |
You can use this to check your keyboard mappings, for example. |
|
40 |
start with: |
|
41 |
EventMonitor open |
|
53 | 42 |
and watch the output on xterm. |
52 | 43 |
" |
44 |
! ! |
|
19 | 45 |
|
1021 | 46 |
!EventMonitor class methodsFor:'defaults'! |
19 | 47 |
|
48 |
defaultExtent |
|
49 |
^ 200 @ 200 |
|
50 |
! |
|
51 |
||
52 |
defaultLabel |
|
53 |
^ 'Event Monitor' |
|
54 |
! ! |
|
55 |
||
56 |
!EventMonitor methodsFor:'events'! |
|
57 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
58 |
buttonMotion:state x:x y:y |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
59 |
'buttonMotion x:' print. x print. ' y:' print. y print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
60 |
' state:' print. state printNL |
19 | 61 |
! |
62 |
||
63 |
buttonPress:button x:x y:y |
|
64 |
'buttonPress x:' print. x print. ' y:' print. y print. |
|
45 | 65 |
' button:' print. button printNL |
19 | 66 |
! |
67 |
||
68 |
buttonRelease:button x:x y:y |
|
69 |
'buttonRelease x:' print. x print. ' y:' print. y print. |
|
45 | 70 |
' button:' print. button printNL |
19 | 71 |
! |
72 |
||
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
73 |
configureX:x y:y width:newWidth height:newHeight |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
74 |
'configure x:' print. x print. ' y:' print. y print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
75 |
' width:' print. newWidth print. ' height:' print. newHeight printNL. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
76 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
77 |
^ super configureX:x y:y width:newWidth height:newHeight |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
78 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
79 |
"Modified: 7.3.1996 / 15:05:15 / cg" |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
80 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
81 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
82 |
focusIn |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
83 |
'focusIn' printNL. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
84 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
85 |
"Created: 7.3.1996 / 15:06:18 / cg" |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
86 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
87 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
88 |
focusOut |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
89 |
'focusOut' printNL. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
90 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
91 |
"Created: 7.3.1996 / 15:06:21 / cg" |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
92 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
93 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
94 |
keyPress:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
95 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
96 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
97 |
'KeyPress x:' print. x print. ' y:' print. y print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
98 |
(key isMemberOf:Character) ifTrue:[ |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
99 |
' character key:' print. key print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
100 |
' (' print. key asciiValue print. ')' print |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
101 |
] ifFalse:[ |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
102 |
' symbolic key:' print. key storeString print. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
103 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
104 |
untranslatedKey ~~ key ifTrue:[ |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
105 |
' untranslated key:' print. untranslatedKey print |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
106 |
] |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
107 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
108 |
|
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
109 |
'' printCR |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
110 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
111 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
112 |
keyRelease:key x:x y:y |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
113 |
|untranslatedKey| |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
114 |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
115 |
'KeyRelease x:' print. x print. ' y:' print. y print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
116 |
(key isMemberOf:Character) ifTrue:[ |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
117 |
' character key:' print. key print. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
118 |
' (' print. key asciiValue print. ')' print |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
119 |
] ifFalse:[ |
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
120 |
' symbolic key:' print. key storeString print. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
121 |
untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key. |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
122 |
untranslatedKey ~~ key ifTrue:[ |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
123 |
' untranslated key:' print. untranslatedKey print |
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
124 |
] |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
125 |
]. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
126 |
|
640
7608b07af7bb
show untranslated key as well
Claus Gittinger <cg@exept.de>
parents:
433
diff
changeset
|
127 |
'' printCR |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
128 |
! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
129 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
130 |
mapped |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
131 |
'mapped' printNL |
45 | 132 |
! |
133 |
||
52 | 134 |
pointerEnter:state x:x y:y |
135 |
'pointerEnter x:' print. x print. ' y:' print. y print. |
|
136 |
' state:' print. state printNL |
|
137 |
! |
|
138 |
||
139 |
pointerLeave:state |
|
140 |
'pointerLeave state:' print. state printNL |
|
141 |
! |
|
142 |
||
45 | 143 |
unmapped |
144 |
'unmapped' printNL |
|
145 |
! |
|
146 |
||
147 |
visibilityChange:how |
|
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
148 |
'visibilityChange:' print. how storeString printNL |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
149 |
! ! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
150 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
151 |
!EventMonitor methodsFor:'initialization'! |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
152 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
153 |
initialize |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
154 |
|l| |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
155 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
156 |
super initialize. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
157 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
158 |
l := Label label:'see event trace\on standard output' withCRs in:self. |
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
159 |
l borderWidth:0 |
19 | 160 |
! ! |
161 |
||
162 |
!EventMonitor methodsFor:'realization'! |
|
163 |
||
164 |
initEvents |
|
165 |
self enableMotionEvents. |
|
45 | 166 |
self enableKeyReleaseEvents. |
52 | 167 |
self enableEnterLeaveEvents. |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
168 |
self enableFocusEvents. |
45 | 169 |
self enableEvent:#visibilityChange |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
170 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
171 |
"Modified: 7.3.1996 / 15:06:42 / cg" |
19 | 172 |
! ! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
173 |
|
1021 | 174 |
!EventMonitor class methodsFor:'documentation'! |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
175 |
|
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
176 |
version |
1052 | 177 |
^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.14 1997-03-02 10:21:01 cg Exp $' |
433
703d84558f6f
also show config & focus events
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
178 |
! ! |