author | Claus Gittinger <cg@exept.de> |
Sat, 11 Nov 1995 16:41:09 +0100 | |
changeset 165 | df29ee4514c1 |
parent 128 | 6eb4cc559360 |
child 433 | 703d84558f6f |
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 |
'From Smalltalk/X, Version:1.4 on 19-Jul-91 at 18:34:01'! |
14 |
||
15 |
StandardSystemView subclass:#EventMonitor |
|
45 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Tools' |
|
19 | 20 |
! |
21 |
||
52 | 22 |
!EventMonitor class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
19 | 28 |
|
52 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
version |
|
165
df29ee4514c1
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
128
diff
changeset
|
39 |
^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.10 1995-11-11 15:39:54 cg Exp $' |
52 | 40 |
! |
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
like xev - show events. |
|
45 |
You can use this to check your keyboard mappings, for example. |
|
46 |
start with: |
|
47 |
EventMonitor open |
|
53 | 48 |
and watch the output on xterm. |
52 | 49 |
" |
50 |
! ! |
|
19 | 51 |
|
52 |
!EventMonitor class methodsFor:'defaults'! |
|
53 |
||
54 |
defaultExtent |
|
55 |
^ 200 @ 200 |
|
56 |
! |
|
57 |
||
58 |
defaultLabel |
|
59 |
^ 'Event Monitor' |
|
60 |
! ! |
|
61 |
||
52 | 62 |
!EventMonitor methodsFor:'initialization'! |
63 |
||
64 |
initialize |
|
57 | 65 |
|l| |
66 |
||
52 | 67 |
super initialize. |
68 |
||
57 | 69 |
l := Label label:'see event trace\on standard output' withCRs in:self. |
70 |
l borderWidth:0 |
|
52 | 71 |
! ! |
72 |
||
19 | 73 |
!EventMonitor methodsFor:'events'! |
74 |
||
75 |
keyPress:key x:x y:y |
|
76 |
'KeyPress x:' print. x print. ' y:' print. y print. |
|
77 |
(key isMemberOf:Character) ifTrue:[ |
|
45 | 78 |
' character key:' print. key print. |
79 |
' (' print. key asciiValue print. ')' print |
|
19 | 80 |
] ifFalse:[ |
45 | 81 |
' symbolic key:' print. key print |
19 | 82 |
]. |
83 |
||
45 | 84 |
'' printNL |
85 |
! |
|
86 |
||
87 |
keyRelease:key x:x y:y |
|
88 |
'KeyRelease x:' print. x print. ' y:' print. y print. |
|
89 |
(key isMemberOf:Character) ifTrue:[ |
|
90 |
' character key:' print. key print. |
|
91 |
' (' print. key asciiValue print. ')' print |
|
92 |
] ifFalse:[ |
|
93 |
' symbolic key:' print. key print |
|
94 |
]. |
|
95 |
||
96 |
'' printNL |
|
19 | 97 |
! |
98 |
||
99 |
buttonPress:button x:x y:y |
|
100 |
'buttonPress x:' print. x print. ' y:' print. y print. |
|
45 | 101 |
' button:' print. button printNL |
19 | 102 |
! |
103 |
||
104 |
buttonRelease:button x:x y:y |
|
105 |
'buttonRelease x:' print. x print. ' y:' print. y print. |
|
45 | 106 |
' button:' print. button printNL |
19 | 107 |
! |
108 |
||
109 |
buttonMotion:button x:x y:y |
|
110 |
'buttonMotion x:' print. x print. ' y:' print. y print. |
|
45 | 111 |
' button:' print. button printNL |
112 |
! |
|
113 |
||
52 | 114 |
pointerEnter:state x:x y:y |
115 |
'pointerEnter x:' print. x print. ' y:' print. y print. |
|
116 |
' state:' print. state printNL |
|
117 |
! |
|
118 |
||
119 |
pointerLeave:state |
|
120 |
'pointerLeave state:' print. state printNL |
|
121 |
! |
|
122 |
||
45 | 123 |
mapped |
124 |
'mapped' printNL |
|
125 |
! |
|
126 |
||
127 |
unmapped |
|
128 |
'unmapped' printNL |
|
129 |
! |
|
130 |
||
131 |
visibilityChange:how |
|
132 |
'visibilityChange:' print. how printNL |
|
19 | 133 |
! ! |
134 |
||
135 |
!EventMonitor methodsFor:'realization'! |
|
136 |
||
137 |
initEvents |
|
73 | 138 |
"/ self enableButtonEvents. |
139 |
"/ self enableButtonMotionEvents. |
|
19 | 140 |
self enableMotionEvents. |
45 | 141 |
self enableKeyReleaseEvents. |
52 | 142 |
self enableEnterLeaveEvents. |
45 | 143 |
self enableEvent:#visibilityChange |
19 | 144 |
! ! |