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