author | Claus Gittinger <cg@exept.de> |
Fri, 10 Jan 1997 18:32:24 +0100 | |
changeset 357 | 4bcb93f5892e |
parent 327 | 08f7c1c026b6 |
child 574 | a4fe01515dc1 |
permissions | -rw-r--r-- |
60 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
77 | 3 |
All Rights Reserved |
60 | 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 |
||
13 |
||
14 |
||
15 |
Object subclass:#EventListener |
|
212 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Support' |
|
60 | 20 |
! |
21 |
||
327
08f7c1c026b6
no longer send buttonShiftPress messages (has to be done in the
Claus Gittinger <cg@exept.de>
parents:
222
diff
changeset
|
22 |
!EventListener class methodsFor:'documentation'! |
60 | 23 |
|
123 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
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 |
||
60 | 38 |
! |
39 |
||
40 |
documentation |
|
41 |
" |
|
98 | 42 |
abstract class for event listeners. EventListeners can be used to intercept |
43 |
incoming events (keyboard & mouse) directly from a sensor, or even |
|
44 |
for a complete display device. |
|
45 |
One application is the automatic help, which tracks entering/leaving |
|
46 |
views, to popup some help message. See concrete code in ActiveHelp. |
|
47 |
For each intercepted event, a corresponding method is called for in instances |
|
48 |
of myself - these should return true, if the event is to be ignored (i.e. |
|
49 |
assumed to be processed and consumed by the reader, or false, if the normal |
|
50 |
event procedure should be performed. Since this is an abstract class, |
|
51 |
all of my intercept methods return false. They are meant to be redefined |
|
52 |
in concrete subclasses. |
|
212 | 53 |
|
54 |
[see also:] |
|
55 |
WindowSensor WindowEvent WindowGroup |
|
222 | 56 |
|
57 |
[author:] |
|
58 |
Claus Gittinger |
|
60 | 59 |
" |
60 |
! ! |
|
61 |
||
62 |
!EventListener methodsFor:'events'! |
|
63 |
||
123 | 64 |
buttonMotion:state x:x y:y view:aView |
213 | 65 |
"not handled here - should be redefined in a concrete subclas" |
66 |
||
60 | 67 |
^ false |
213 | 68 |
|
69 |
"Modified: 23.4.1996 / 21:57:54 / cg" |
|
60 | 70 |
! |
71 |
||
72 |
buttonMultiPress:button x:x y:y view:aView |
|
213 | 73 |
"not handled here - should be redefined in a concrete subclas" |
74 |
||
60 | 75 |
^ false |
76 |
||
213 | 77 |
"Modified: 23.4.1996 / 21:57:58 / cg" |
60 | 78 |
! |
79 |
||
80 |
buttonPress:button x:x y:y view:aView |
|
213 | 81 |
"not handled here - should be redefined in a concrete subclas" |
82 |
||
60 | 83 |
^ false |
84 |
||
213 | 85 |
"Modified: 23.4.1996 / 21:58:01 / cg" |
60 | 86 |
! |
87 |
||
123 | 88 |
buttonRelease:button x:x y:y view:aView |
213 | 89 |
"not handled here - should be redefined in a concrete subclas" |
90 |
||
60 | 91 |
^ false |
123 | 92 |
|
213 | 93 |
"Modified: 23.4.1996 / 21:58:03 / cg" |
60 | 94 |
! |
95 |
||
123 | 96 |
keyPress:key x:x y:y view:aView |
213 | 97 |
"not handled here - should be redefined in a concrete subclas" |
98 |
||
123 | 99 |
^ false |
100 |
||
213 | 101 |
"Modified: 23.4.1996 / 21:58:08 / cg" |
123 | 102 |
! |
103 |
||
104 |
keyRelease:key x:x y:y view:aView |
|
213 | 105 |
"not handled here - should be redefined in a concrete subclas" |
106 |
||
60 | 107 |
^ false |
108 |
||
213 | 109 |
"Modified: 23.4.1996 / 21:58:11 / cg" |
60 | 110 |
! |
111 |
||
112 |
pointerEnter:state x:x y:y view:view |
|
213 | 113 |
"not handled here - should be redefined in a concrete subclas" |
114 |
||
60 | 115 |
^ false |
116 |
||
213 | 117 |
"Modified: 23.4.1996 / 21:58:14 / cg" |
60 | 118 |
! |
119 |
||
123 | 120 |
pointerLeave:state view:view |
213 | 121 |
"not handled here - should be redefined in a concrete subclas" |
122 |
||
60 | 123 |
^ false |
124 |
||
213 | 125 |
"Modified: 23.4.1996 / 21:58:17 / cg" |
60 | 126 |
! ! |
127 |
||
128 |
!EventListener methodsFor:'listen'! |
|
129 |
||
130 |
listen |
|
131 |
"install myself as listener" |
|
132 |
||
133 |
WindowSensor eventListener:self |
|
134 |
||
135 |
" |
|
136 |
|listener| |
|
137 |
||
138 |
listener := EventListener new. |
|
139 |
listener listen. |
|
140 |
(Delay forSeconds:20) wait. |
|
141 |
listener unlisten |
|
142 |
" |
|
143 |
! |
|
144 |
||
145 |
unlisten |
|
146 |
"uninstall myself as listener" |
|
147 |
||
148 |
WindowSensor eventListener:nil |
|
149 |
! ! |
|
123 | 150 |
|
327
08f7c1c026b6
no longer send buttonShiftPress messages (has to be done in the
Claus Gittinger <cg@exept.de>
parents:
222
diff
changeset
|
151 |
!EventListener class methodsFor:'documentation'! |
127 | 152 |
|
153 |
version |
|
327
08f7c1c026b6
no longer send buttonShiftPress messages (has to be done in the
Claus Gittinger <cg@exept.de>
parents:
222
diff
changeset
|
154 |
^ '$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.12 1996-08-01 16:18:57 cg Exp $' |
127 | 155 |
! ! |