KeyboardForwarder.st
changeset 3094 7ef0f53288bc
parent 2506 221b75206a75
child 3682 d756fdb95712
--- a/KeyboardForwarder.st	Wed Dec 08 21:48:26 1999 +0100
+++ b/KeyboardForwarder.st	Wed Dec 08 21:50:13 1999 +0100
@@ -314,7 +314,7 @@
      forward the event (i.e. after I returned true on handlesKeyPress:.
      Take care of cyclic delegation (via a kludge-test for negative coordinate)."
 
-    |xDel yDel|
+    |xDel yDel forwardedEvent|
 
     x isNil ifTrue:[
         "
@@ -342,18 +342,14 @@
         destination keyPress:key x:nil y:nil view:aView.
     ] ifFalse:[
         destinationView notNil ifTrue:[
+            forwardedEvent := WindowEvent inputEvent
+                                for:destinationView
+                                type:#keyPress:x:y:
+                                arguments:(Array with:key with:xDel with:yDel).
             destinationView
-                dispatchEvent:#keyPress:x:y:
-                arguments:(Array with:key with:xDel with:yDel) 
+                dispatchEvent:forwardedEvent
                 withFocusOn:nil 
                 delegate:false
-
-"/            WindowEvent
-"/                sendEvent:#keyPress:x:y: 
-"/                arguments:(Array with:key with:xDel with:yDel) 
-"/                view:destinationView 
-"/                withFocusOn:nil 
-"/                delegate:false
         ]
     ]
 
@@ -365,6 +361,8 @@
      forward the event (i.e. after I returned true on handlesKeyRelease:.
      Take care of cyclic delegation (via a kludge-test for negative coordinate)."
 
+    |forwardedEvent|
+
     x < 0 ifTrue:[
         "
          already delegated ... ignore
@@ -380,16 +378,14 @@
         destination keyRelease:key x:-1 y:-1 view:aView
     ] ifFalse:[
         destinationView notNil ifTrue:[
+            forwardedEvent := WindowEvent inputEvent
+                                for:destinationView
+                                type:#keyRelease:x:y:
+                                arguments:(Array with:key with:-1 with:-1).
             destinationView
-                dispatchEvent:#keyRelease:x:y:
-                arguments:(Array with:key with:-1 with:-1) 
+                dispatchEvent:forwardedEvent
                 withFocusOn:nil 
                 delegate:false
-
-"/            WindowEvent
-"/                sendEvent:#keyRelease:x:y:
-"/                arguments:(Array with:key with:-1 with:-1)
-"/                view:destinationView
         ]
     ]
 
@@ -496,5 +492,5 @@
 !KeyboardForwarder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.24 1999-03-14 13:00:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.25 1999-12-08 20:49:59 ca Exp $'
 ! !