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 |
|
|
22 |
EventMonitor comment:'
|
52
|
23 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
|
24 |
All Rights Reserved
|
|
25 |
|
57
|
26 |
$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.5 1995-02-06 00:59:50 claus Exp $
|
52
|
27 |
'!
|
19
|
28 |
|
52
|
29 |
!EventMonitor class methodsFor:'documentation'!
|
|
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 |
version
|
|
46 |
"
|
57
|
47 |
$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.5 1995-02-06 00:59:50 claus Exp $
|
52
|
48 |
"
|
|
49 |
!
|
|
50 |
|
|
51 |
documentation
|
|
52 |
"
|
|
53 |
like xev - show events.
|
|
54 |
You can use this to check your keyboard mappings, for example.
|
|
55 |
start with:
|
|
56 |
EventMonitor open
|
53
|
57 |
and watch the output on xterm.
|
52
|
58 |
"
|
|
59 |
! !
|
19
|
60 |
|
|
61 |
!EventMonitor class methodsFor:'defaults'!
|
|
62 |
|
|
63 |
defaultExtent
|
|
64 |
^ 200 @ 200
|
|
65 |
!
|
|
66 |
|
|
67 |
defaultLabel
|
|
68 |
^ 'Event Monitor'
|
|
69 |
! !
|
|
70 |
|
52
|
71 |
!EventMonitor methodsFor:'initialization'!
|
|
72 |
|
|
73 |
initialize
|
57
|
74 |
|l|
|
|
75 |
|
52
|
76 |
super initialize.
|
|
77 |
|
57
|
78 |
l := Label label:'see event trace\on standard output' withCRs in:self.
|
|
79 |
l borderWidth:0
|
52
|
80 |
! !
|
|
81 |
|
19
|
82 |
!EventMonitor methodsFor:'events'!
|
|
83 |
|
|
84 |
keyPress:key x:x y:y
|
|
85 |
'KeyPress x:' print. x print. ' y:' print. y print.
|
|
86 |
(key isMemberOf:Character) ifTrue:[
|
45
|
87 |
' character key:' print. key print.
|
|
88 |
' (' print. key asciiValue print. ')' print
|
19
|
89 |
] ifFalse:[
|
45
|
90 |
' symbolic key:' print. key print
|
19
|
91 |
].
|
|
92 |
|
45
|
93 |
'' printNL
|
|
94 |
!
|
|
95 |
|
|
96 |
keyRelease:key x:x y:y
|
|
97 |
'KeyRelease x:' print. x print. ' y:' print. y print.
|
|
98 |
(key isMemberOf:Character) ifTrue:[
|
|
99 |
' character key:' print. key print.
|
|
100 |
' (' print. key asciiValue print. ')' print
|
|
101 |
] ifFalse:[
|
|
102 |
' symbolic key:' print. key print
|
|
103 |
].
|
|
104 |
|
|
105 |
'' printNL
|
19
|
106 |
!
|
|
107 |
|
|
108 |
buttonPress:button x:x y:y
|
|
109 |
'buttonPress x:' print. x print. ' y:' print. y print.
|
45
|
110 |
' button:' print. button printNL
|
19
|
111 |
!
|
|
112 |
|
|
113 |
buttonRelease:button x:x y:y
|
|
114 |
'buttonRelease x:' print. x print. ' y:' print. y print.
|
45
|
115 |
' button:' print. button printNL
|
19
|
116 |
!
|
|
117 |
|
|
118 |
buttonMotion:button x:x y:y
|
|
119 |
'buttonMotion x:' print. x print. ' y:' print. y print.
|
45
|
120 |
' button:' print. button printNL
|
|
121 |
!
|
|
122 |
|
52
|
123 |
pointerEnter:state x:x y:y
|
|
124 |
'pointerEnter x:' print. x print. ' y:' print. y print.
|
|
125 |
' state:' print. state printNL
|
|
126 |
!
|
|
127 |
|
|
128 |
pointerLeave:state
|
|
129 |
'pointerLeave state:' print. state printNL
|
|
130 |
!
|
|
131 |
|
45
|
132 |
mapped
|
|
133 |
'mapped' printNL
|
|
134 |
!
|
|
135 |
|
|
136 |
unmapped
|
|
137 |
'unmapped' printNL
|
|
138 |
!
|
|
139 |
|
|
140 |
visibilityChange:how
|
|
141 |
'visibilityChange:' print. how printNL
|
19
|
142 |
! !
|
|
143 |
|
|
144 |
!EventMonitor methodsFor:'realization'!
|
|
145 |
|
|
146 |
initEvents
|
|
147 |
self enableButtonEvents.
|
|
148 |
self enableMotionEvents.
|
45
|
149 |
self enableButtonMotionEvents.
|
|
150 |
self enableKeyReleaseEvents.
|
52
|
151 |
self enableEnterLeaveEvents.
|
45
|
152 |
self enableEvent:#visibilityChange
|
19
|
153 |
! !
|