author | Claus Gittinger <cg@exept.de> |
Fri, 11 May 2018 09:24:54 +0200 | |
changeset 8361 | 8d425e982530 |
parent 7660 | 7541edd3ab40 |
child 8362 | 573b5a8cc1c5 |
permissions | -rw-r--r-- |
128 | 1 |
" |
2 |
COPYRIGHT (c) 1995 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 |
" |
|
3682 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
7660 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
128 | 16 |
Object subclass:#KeyboardForwarder |
400 | 17 |
instanceVariableNames:'sourceView destinationView destination condition filter' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
5277 | 20 |
category:'Interface-Support-UI' |
128 | 21 |
! |
22 |
||
23 |
!KeyboardForwarder class methodsFor:'documentation'! |
|
24 |
||
244 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
128 | 38 |
! |
39 |
||
40 |
documentation |
|
41 |
" |
|
144 | 42 |
Instances of this class can be used to forward keyboard |
43 |
events to some object or other view (install them via aView delegate:). |
|
44 |
Event delegation allows to add additional keyboard functions to views |
|
45 |
WITHOUT modifying their code or changing controllers. |
|
46 |
Also, it allows to catch certain individual keys to ignore them or |
|
47 |
perform different functions. |
|
48 |
||
7660 | 49 |
Notice, that delegates don't have to be instances of |
128 | 50 |
myself; any object with a protocol similar to mine can be used as |
51 |
a delegate. |
|
142 | 52 |
(i.e. any object that responds to |
53 |
handlesKeyPress:view: / keyPress:x:y:view: / delegatesTo: etc.) |
|
139 | 54 |
|
55 |
However, I provide the most common functions required for conditional |
|
56 |
event delegation and instances of myself are for example used to forward |
|
57 |
events from elements of some dialogBoxes to the enterfield/fieldGroup - |
|
144 | 58 |
(which allows keyboard input to be forwarded to the active text-field even |
59 |
while the mouse pointer is somewhere else) |
|
139 | 60 |
|
61 |
Another application of delegation is to catch keyboard input to some standard |
|
62 |
widget, optionally processing and resending the key-event. |
|
128 | 63 |
|
144 | 64 |
I can either forward the key event to another view, or to some general |
65 |
object - the difference is that views are sent a #keyXXX:x:y: message, |
|
66 |
while general destinations get a #keyXXX:x:y:view: message, with the original |
|
67 |
view (the one in which the event occurred) as additional argument. |
|
68 |
||
598 | 69 |
[Instance Variables:] |
139 | 70 |
|
598 | 71 |
destinationView <View> the view which shall receive |
72 |
the forwarded keyboard events. |
|
134 | 73 |
|
598 | 74 |
destination <Object> the object which shall receive |
75 |
the forwarded keyboard events. |
|
139 | 76 |
|
598 | 77 |
sourceView <ViewOrNil> if non-nil, only events from this |
78 |
view are forwarded. |
|
79 |
(currently nowhere used) |
|
134 | 80 |
|
598 | 81 |
condition <Symbol> an additional condition for forwarding |
82 |
currently only #noFocus is implemented. |
|
83 |
The #noFocus condition will only forward |
|
84 |
events if no explicit focus has been |
|
85 |
set in the windowGroup. |
|
144 | 86 |
|
598 | 87 |
<Block> condition block - event is forwarded, |
88 |
if it evaluates to true. |
|
89 |
The block gets 3 arguments: |
|
90 |
eventType #keyPress or #keyRelease |
|
91 |
key the key |
|
92 |
view the originating view |
|
144 | 93 |
|
94 |
For more info on event handling/forwarding, see the documentation in |
|
95 |
WindowSensor, WindowGroup and especially in WindowEvent. |
|
598 | 96 |
|
97 |
[see also:] |
|
98 |
WindowEvent WindowSensor WindowGroup |
|
612 | 99 |
|
100 |
[author:] |
|
101 |
Claus Gittinger |
|
144 | 102 |
" |
103 |
! |
|
104 |
||
105 |
examples |
|
106 |
" |
|
107 |
catch an enterfields input: |
|
620 | 108 |
[exBegin] |
109 |
|top field forwarder catcher| |
|
144 | 110 |
|
620 | 111 |
catcher := Plug new. |
112 |
catcher respondTo:#keyPress:x:y:view: |
|
1752 | 113 |
with:[:key :x :y :view | Transcript showCR:'caught keyPress: ' , key printString.]. |
620 | 114 |
catcher respondTo:#keyRelease:x:y:view: |
1752 | 115 |
with:[:key :x :y :view | Transcript showCR:'caught keyRelease: ' , key printString.]. |
144 | 116 |
|
620 | 117 |
top := StandardSystemView new. |
118 |
top extent:200@200. |
|
119 |
||
120 |
field := EditField in:top. |
|
121 |
field origin:0.0@0.0; width:1.0. |
|
144 | 122 |
|
620 | 123 |
forwarder := KeyboardForwarder to:catcher. |
124 |
field delegate:forwarder. |
|
144 | 125 |
|
620 | 126 |
top open |
127 |
[exEnd] |
|
144 | 128 |
|
129 |
||
130 |
catch an enterfields return-key only: |
|
620 | 131 |
[exBegin] |
132 |
|top field forwarder catcher| |
|
144 | 133 |
|
620 | 134 |
catcher := Plug new. |
135 |
catcher respondTo:#keyPress:x:y:view: |
|
1752 | 136 |
with:[:key :x :y :view | Transcript showCR:'caught return']. |
144 | 137 |
|
620 | 138 |
top := StandardSystemView new. |
139 |
top extent:200@200. |
|
144 | 140 |
|
620 | 141 |
field := EditField in:top. |
142 |
field origin:0.0@0.0; width:1.0. |
|
144 | 143 |
|
620 | 144 |
forwarder := KeyboardForwarder |
145 |
to:catcher |
|
146 |
condition:[:type :key :view | (type == #keyPress) & (key == #Return)]. |
|
147 |
field delegate:forwarder. |
|
144 | 148 |
|
620 | 149 |
top open |
150 |
[exEnd] |
|
144 | 151 |
|
152 |
||
153 |
catch all of an enterfields input and ignore it: |
|
620 | 154 |
[exBegin] |
155 |
|top field forwarder| |
|
144 | 156 |
|
620 | 157 |
top := StandardSystemView new. |
158 |
top extent:200@200. |
|
144 | 159 |
|
620 | 160 |
field := EditField in:top. |
161 |
field origin:0.0@0.0; width:1.0. |
|
144 | 162 |
|
620 | 163 |
forwarder := KeyboardForwarder to:nil. |
164 |
field delegate:forwarder. |
|
144 | 165 |
|
620 | 166 |
top open |
167 |
[exEnd] |
|
128 | 168 |
" |
169 |
! ! |
|
170 |
||
171 |
!KeyboardForwarder class methodsFor:'instance creation'! |
|
172 |
||
139 | 173 |
from:sourceView to:destination |
174 |
"create and return a new KeyboardForwarder to redirect key events |
|
175 |
for sourceView to destination. Events from other than the sourceView |
|
176 |
will not be forwarded. The forwarded event will be reported including |
|
177 |
the original view as argument (i.e. as #keyPress:x:y:view:). |
|
178 |
Use this, if the destination is not a view." |
|
179 |
||
180 |
^ self new sourceView:sourceView; destination:destination |
|
181 |
! |
|
182 |
||
244 | 183 |
from:sourceView toView:destinationView |
184 |
"create and return a new KeyboardForwarder to redirect key events |
|
185 |
for sourceView to destinationView. Events from other than the sourceView |
|
186 |
will not be forwarded. The forwarded event will be reported excluding |
|
139 | 187 |
the original view as argument (i.e. as #keyPress:x:y:). |
188 |
Use this, if the destination is a view." |
|
189 |
||
244 | 190 |
^ self new sourceView:sourceView; destinationView:destinationView |
134 | 191 |
! |
192 |
||
139 | 193 |
to:destination |
194 |
"create and return a new KeyboardForwarder to redirect any key event |
|
195 |
to destination (Independent of the view in which the event originally |
|
196 |
occurred). The forwarded event will be reported including |
|
197 |
the original view as argument (i.e. as #keyPress:x:y:view:). |
|
198 |
Use this, if the destination is not a view." |
|
199 |
||
400 | 200 |
^ self to:destination condition:nil filter:nil |
139 | 201 |
! |
202 |
||
244 | 203 |
to:destination condition:aCondition |
204 |
"create and return a new KeyboardForwarder to redirect any key event |
|
205 |
to destinationView (Independent of the view in which the event originally |
|
206 |
occurred) but only, if some condition as specified by aCondition |
|
207 |
is met. The forwarded event will be reported including |
|
208 |
the original view as argument (i.e. as #keyPress:x:y:view:). |
|
209 |
Use this, if the destination is not a view." |
|
210 |
||
400 | 211 |
^ self to:destination condition:aCondition filter:nil |
212 |
! |
|
213 |
||
214 |
to:destination condition:aCondition filter:aFilterBlock |
|
215 |
"create and return a new KeyboardForwarder to redirect any key event |
|
216 |
to destinationView (Independent of the view in which the event originally |
|
217 |
occurred) but only, if some condition as specified by aCondition |
|
218 |
is met and aFilterBlock returns true for that key. |
|
219 |
The forwarded event will be reported including |
|
220 |
the original view as argument (i.e. as #keyPress:x:y:view:). |
|
221 |
Use this, if the destination is not a view." |
|
222 |
||
223 |
^ self new destination:destination; condition:aCondition; filter:aFilterBlock |
|
244 | 224 |
! |
225 |
||
226 |
toView:destinationView |
|
227 |
"create and return a new KeyboardForwarder to redirect any key event |
|
228 |
to destinationView (Independent of the view in which the event originally |
|
229 |
occurred). The forwarded event will be reported excluding |
|
230 |
the original view as argument (i.e. as #keyPress:x:y:). |
|
231 |
Use this, if the destination is a view." |
|
232 |
||
400 | 233 |
^ self toView:destinationView condition:nil filter:nil |
244 | 234 |
! |
235 |
||
144 | 236 |
toView:destinationView condition:aCondition |
139 | 237 |
"create and return a new KeyboardForwarder to redirect any key event |
238 |
to destinationView (Independent of the view in which the event originally |
|
144 | 239 |
occurred) but only, if some condition as specified by aCondition |
139 | 240 |
is met. The forwarded event will be reported excluding |
241 |
the original view as argument (i.e. as #keyPress:x:y:). |
|
242 |
Use this, if the destination is a view." |
|
243 |
||
400 | 244 |
^ self toView:destinationView condition:aCondition filter:nil |
245 |
! |
|
246 |
||
247 |
toView:destinationView condition:aCondition filter:aFilterBlock |
|
248 |
"create and return a new KeyboardForwarder to redirect any key event |
|
249 |
to destinationView (Independent of the view in which the event originally |
|
250 |
occurred) but only, if some condition as specified by aCondition |
|
251 |
is met and aFilterBlock returns true for that key. |
|
252 |
The forwarded event will be reported excluding |
|
253 |
the original view as argument (i.e. as #keyPress:x:y:). |
|
254 |
Use this, if the destination is a view." |
|
255 |
||
256 |
^ self new destinationView:destinationView; condition:aCondition; filter:aFilterBlock |
|
128 | 257 |
! ! |
258 |
||
144 | 259 |
!KeyboardForwarder methodsFor:'accessing'! |
128 | 260 |
|
134 | 261 |
condition:aCondition |
144 | 262 |
"set the condition - typically a block" |
263 |
||
134 | 264 |
condition := aCondition |
265 |
! |
|
266 |
||
244 | 267 |
destination |
268 |
"return the destination" |
|
144 | 269 |
|
244 | 270 |
^ destination |
139 | 271 |
! |
272 |
||
273 |
destination:anObject |
|
144 | 274 |
"set the destination |
275 |
- that one will get the event with an additional view arg." |
|
276 |
||
139 | 277 |
destination := anObject |
278 |
! |
|
279 |
||
244 | 280 |
destinationView |
281 |
"return the destination view" |
|
144 | 282 |
|
244 | 283 |
^ destinationView |
139 | 284 |
! |
285 |
||
244 | 286 |
destinationView:aView |
287 |
"set the destination view" |
|
144 | 288 |
|
244 | 289 |
destinationView := aView |
128 | 290 |
! |
291 |
||
400 | 292 |
filter:aOneArgBlock |
293 |
"set the filter - if non-nil, only keys for which it returns true are forwarded" |
|
294 |
||
295 |
filter := aOneArgBlock |
|
296 |
||
297 |
"Created: 4.2.1996 / 20:35:15 / cg" |
|
298 |
! |
|
299 |
||
128 | 300 |
sourceView |
144 | 301 |
"get the sourceView - if nonNil, only events from this view will be forwarded" |
302 |
||
128 | 303 |
^ sourceView |
142 | 304 |
! |
305 |
||
244 | 306 |
sourceView:aView |
307 |
"set the sourceView - if nonNil, only events from this view will be forwarded" |
|
128 | 308 |
|
244 | 309 |
sourceView := aView |
128 | 310 |
! ! |
311 |
||
312 |
!KeyboardForwarder methodsFor:'event forwarding'! |
|
313 |
||
314 |
keyPress:key x:x y:y view:aView |
|
139 | 315 |
"handle a delegated event - this is sent by the sensor to actually |
316 |
forward the event (i.e. after I returned true on handlesKeyPress:. |
|
317 |
Take care of cyclic delegation (via a kludge-test for negative coordinate)." |
|
318 |
||
3094 | 319 |
|xDel yDel forwardedEvent| |
1967
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
320 |
|
490
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
321 |
x isNil ifTrue:[ |
400 | 322 |
" |
323 |
already delegated ... ignore |
|
324 |
" |
|
325 |
^ self |
|
326 |
]. |
|
327 |
||
328 |
filter notNil ifTrue:[ |
|
329 |
(filter value:key) ifFalse:[^ self]. |
|
128 | 330 |
]. |
331 |
||
1967
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
332 |
xDel := x. |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
333 |
yDel := y. |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
334 |
|
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
335 |
x == 0 ifTrue:[ |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
336 |
" |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
337 |
already delegated ... care to not delegate twice |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
338 |
" |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
339 |
xDel := nil. |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
340 |
yDel := nil. |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
341 |
]. |
4aea1cea284e
care for recursive redelegation
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
342 |
|
139 | 343 |
destination notNil ifTrue:[ |
490
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
344 |
destination keyPress:key x:nil y:nil view:aView. |
139 | 345 |
] ifFalse:[ |
400 | 346 |
destinationView notNil ifTrue:[ |
3682 | 347 |
forwardedEvent := WindowEvent keyPress:key x:xDel y:yDel view:destinationView. |
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
348 |
destinationView |
3094 | 349 |
dispatchEvent:forwardedEvent |
693
ed557e02b378
dont redelegate delegated messages
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
350 |
withFocusOn:nil |
ed557e02b378
dont redelegate delegated messages
Claus Gittinger <cg@exept.de>
parents:
620
diff
changeset
|
351 |
delegate:false |
400 | 352 |
] |
139 | 353 |
] |
400 | 354 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
355 |
"Modified: / 20.5.1998 / 22:54:05 / cg" |
128 | 356 |
! |
357 |
||
358 |
keyRelease:key x:x y:y view:aView |
|
139 | 359 |
"handle a delegated event - this is sent by the sensor to actually |
360 |
forward the event (i.e. after I returned true on handlesKeyRelease:. |
|
361 |
Take care of cyclic delegation (via a kludge-test for negative coordinate)." |
|
362 |
||
3094 | 363 |
|forwardedEvent| |
364 |
||
128 | 365 |
x < 0 ifTrue:[ |
400 | 366 |
" |
367 |
already delegated ... ignore |
|
368 |
" |
|
369 |
^ self |
|
370 |
]. |
|
371 |
||
372 |
filter notNil ifTrue:[ |
|
373 |
(filter value:key) ifFalse:[^ self]. |
|
128 | 374 |
]. |
375 |
||
139 | 376 |
destination notNil ifTrue:[ |
400 | 377 |
destination keyRelease:key x:-1 y:-1 view:aView |
139 | 378 |
] ifFalse:[ |
400 | 379 |
destinationView notNil ifTrue:[ |
3682 | 380 |
forwardedEvent := WindowEvent keyRelease:key x:-1 y:-1 view:destinationView. |
381 |
destinationView dispatchEvent:forwardedEvent withFocusOn:nil delegate:false |
|
400 | 382 |
] |
139 | 383 |
] |
400 | 384 |
|
2126
1f108c76dfdb
moved event dispatching code to view (where it belongs)
Claus Gittinger <cg@exept.de>
parents:
1967
diff
changeset
|
385 |
"Modified: / 20.5.1998 / 22:54:32 / cg" |
128 | 386 |
! ! |
244 | 387 |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
388 |
!KeyboardForwarder methodsFor:'focus forwarding'! |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
389 |
|
2506 | 390 |
hasKeyboardFocus:aBoolean |
391 |
"forward focus information to my destination" |
|
392 |
||
393 |
destinationView notNil ifTrue:[ |
|
394 |
destinationView hasKeyboardFocus:aBoolean |
|
395 |
]. |
|
396 |
||
397 |
"Modified: 25.2.1997 / 23:16:35 / cg" |
|
398 |
! |
|
399 |
||
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
400 |
showFocus:explicit |
1380 | 401 |
"forward focus information to my destination" |
402 |
||
403 |
|d| |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
404 |
|
1380 | 405 |
destinationView notNil ifTrue:[ |
406 |
d := destinationView |
|
407 |
] ifFalse:[ |
|
408 |
d := destination |
|
409 |
]. |
|
410 |
d notNil ifTrue:[ |
|
411 |
d showFocus:explicit |
|
412 |
] |
|
413 |
||
414 |
"Modified: 25.2.1997 / 23:16:35 / cg" |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
415 |
! |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
416 |
|
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
417 |
showNoFocus:explicit |
1380 | 418 |
"forward focus information to my destination" |
419 |
||
420 |
|d| |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
421 |
|
1380 | 422 |
destinationView notNil ifTrue:[ |
423 |
d := destinationView |
|
424 |
] ifFalse:[ |
|
425 |
d := destination |
|
426 |
]. |
|
427 |
d notNil ifTrue:[ |
|
428 |
d showNoFocus:explicit |
|
429 |
] |
|
430 |
||
431 |
"Modified: 25.2.1997 / 23:16:40 / cg" |
|
385
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
432 |
! ! |
15fd1c806d2a
pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
433 |
|
244 | 434 |
!KeyboardForwarder methodsFor:'queries'! |
435 |
||
436 |
checkCondition:type key:key view:aView |
|
1941 | 437 |
"return true, if I am interested in an event with type (#keyPress or |
438 |
#keyRelease) and key for aView." |
|
439 |
||
1693 | 440 |
|wg| |
441 |
||
400 | 442 |
filter notNil ifTrue:[ |
443 |
(filter value:key) ifFalse:[^ false]. |
|
444 |
]. |
|
445 |
||
244 | 446 |
condition notNil ifTrue:[ |
400 | 447 |
condition == #noFocus ifTrue:[ |
1941 | 448 |
wg := aView windowGroup. |
449 |
(wg isNil or:[wg focusView notNil]) ifTrue:[^ false] |
|
400 | 450 |
]. |
451 |
condition isBlock ifTrue:[ |
|
452 |
(condition value:type value:key value:aView) ifFalse:[^ false] |
|
453 |
] |
|
244 | 454 |
]. |
455 |
sourceView notNil ifTrue:[ |
|
400 | 456 |
^ aView == sourceView |
244 | 457 |
]. |
458 |
^ true |
|
400 | 459 |
|
1941 | 460 |
"Modified: / 31.10.1997 / 20:24:42 / cg" |
244 | 461 |
! |
462 |
||
463 |
delegatesTo:someone |
|
464 |
"return true, if I delegate events to someone" |
|
465 |
||
466 |
^ destination == someone or:[destinationView == someone] |
|
467 |
! |
|
468 |
||
6352 | 469 |
handlesButtonMotion:something inView:aView |
470 |
"I am not interested in button events" |
|
471 |
||
472 |
^ false |
|
473 |
! |
|
474 |
||
475 |
handlesButtonPress:something inView:aView |
|
476 |
"I am not interested in button events" |
|
477 |
||
478 |
^ false |
|
479 |
! |
|
480 |
||
244 | 481 |
handlesKeyPress:key inView:aView |
482 |
"this is the query from the sensor to ask me if I would like to |
|
483 |
get a keyPress event for key from aView. Return true, if I want so, |
|
484 |
false otherwise." |
|
485 |
||
486 |
^ self checkCondition:#keyPress key:key view:aView |
|
487 |
! |
|
488 |
||
489 |
handlesKeyRelease:key inView:aView |
|
490 |
"this is the query from the sensor to ask me if I would like to |
|
491 |
get a keyRelease event for key from aView. Return true, if I want so, |
|
492 |
false otherwise." |
|
493 |
||
494 |
^ self checkCondition:#keyRelease key:key view:aView |
|
6352 | 495 |
! |
496 |
||
497 |
handlesPointerEnter:something inView:aView |
|
498 |
"I am not interested in pointer events" |
|
499 |
||
500 |
^ false |
|
501 |
! |
|
502 |
||
503 |
handlesPointerLeave:something inView:aView |
|
504 |
"I am not interested in pointer events" |
|
505 |
||
506 |
^ false |
|
244 | 507 |
! ! |
508 |
||
251 | 509 |
!KeyboardForwarder class methodsFor:'documentation'! |
510 |
||
511 |
version |
|
7660 | 512 |
^ '$Header$' |
251 | 513 |
! ! |
6352 | 514 |