KeyboardForwarder.st
changeset 3682 d756fdb95712
parent 3094 7ef0f53288bc
child 5277 27d26caa8086
equal deleted inserted replaced
3681:358b0a956887 3682:d756fdb95712
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
       
    14 "{ Package: 'stx:libview' }"
       
    15 
    14 Object subclass:#KeyboardForwarder
    16 Object subclass:#KeyboardForwarder
    15 	instanceVariableNames:'sourceView destinationView destination condition filter'
    17 	instanceVariableNames:'sourceView destinationView destination condition filter'
    16 	classVariableNames:''
    18 	classVariableNames:''
    17 	poolDictionaries:''
    19 	poolDictionaries:''
    18 	category:'Interface-Support'
    20 	category:'Interface-Support'
   340 
   342 
   341     destination notNil ifTrue:[
   343     destination notNil ifTrue:[
   342         destination keyPress:key x:nil y:nil view:aView.
   344         destination keyPress:key x:nil y:nil view:aView.
   343     ] ifFalse:[
   345     ] ifFalse:[
   344         destinationView notNil ifTrue:[
   346         destinationView notNil ifTrue:[
   345             forwardedEvent := WindowEvent inputEvent
   347             forwardedEvent := WindowEvent keyPress:key x:xDel y:yDel view:destinationView.
   346                                 for:destinationView
       
   347                                 type:#keyPress:x:y:
       
   348                                 arguments:(Array with:key with:xDel with:yDel).
       
   349             destinationView
   348             destinationView
   350                 dispatchEvent:forwardedEvent
   349                 dispatchEvent:forwardedEvent
   351                 withFocusOn:nil 
   350                 withFocusOn:nil 
   352                 delegate:false
   351                 delegate:false
   353         ]
   352         ]
   376 
   375 
   377     destination notNil ifTrue:[
   376     destination notNil ifTrue:[
   378         destination keyRelease:key x:-1 y:-1 view:aView
   377         destination keyRelease:key x:-1 y:-1 view:aView
   379     ] ifFalse:[
   378     ] ifFalse:[
   380         destinationView notNil ifTrue:[
   379         destinationView notNil ifTrue:[
   381             forwardedEvent := WindowEvent inputEvent
   380             forwardedEvent := WindowEvent keyRelease:key x:-1 y:-1 view:destinationView.
   382                                 for:destinationView
   381             destinationView dispatchEvent:forwardedEvent withFocusOn:nil delegate:false
   383                                 type:#keyRelease:x:y:
       
   384                                 arguments:(Array with:key with:-1 with:-1).
       
   385             destinationView
       
   386                 dispatchEvent:forwardedEvent
       
   387                 withFocusOn:nil 
       
   388                 delegate:false
       
   389         ]
   382         ]
   390     ]
   383     ]
   391 
   384 
   392     "Modified: / 20.5.1998 / 22:54:32 / cg"
   385     "Modified: / 20.5.1998 / 22:54:32 / cg"
   393 ! !
   386 ! !
   490 ! !
   483 ! !
   491 
   484 
   492 !KeyboardForwarder class methodsFor:'documentation'!
   485 !KeyboardForwarder class methodsFor:'documentation'!
   493 
   486 
   494 version
   487 version
   495     ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.25 1999-12-08 20:49:59 ca Exp $'
   488     ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.26 2002-08-02 11:57:28 ca Exp $'
   496 ! !
   489 ! !