SynchronousWindowSensor.st
changeset 730 43d9c5848424
parent 615 59b046c2e44f
child 743 64c9b71b3cc4
equal deleted inserted replaced
729:d2fdca1c2895 730:43d9c5848424
     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 WindowSensor subclass:#SynchronousWindowSensor
    13 WindowSensor subclass:#SynchronousWindowSensor
    14 	instanceVariableNames:'device'
    14 	instanceVariableNames:''
    15 	classVariableNames:''
    15 	classVariableNames:''
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Interface-Support'
    17 	category:'Interface-Support'
    18 !
    18 !
    19 
    19 
    55     [author:]
    55     [author:]
    56         Claus Gittinger
    56         Claus Gittinger
    57 "
    57 "
    58 ! !
    58 ! !
    59 
    59 
    60 !SynchronousWindowSensor methodsFor:'accessing'!
       
    61 
       
    62 device
       
    63     "return device"
       
    64 
       
    65     ^ device
       
    66 
       
    67     "Created: 24.11.1995 / 19:28:25 / cg"
       
    68 !
       
    69 
       
    70 device:something
       
    71     "set device"
       
    72 
       
    73     device := something.
       
    74 
       
    75     "Created: 24.11.1995 / 19:28:25 / cg"
       
    76 ! !
       
    77 
       
    78 !SynchronousWindowSensor methodsFor:'event handling'!
    60 !SynchronousWindowSensor methodsFor:'event handling'!
    79 
    61 
    80 buttonMotion:button x:x y:y view:aView
    62 buttonMotion:button x:x y:y view:aView
    81     "forward a button-motion for some view"
    63     "forward a button-motion for some view"
    82 
    64 
   205 
   187 
   206     |xlatedKey|
   188     |xlatedKey|
   207 
   189 
   208     self key:untranslatedKey state:true. 
   190     self key:untranslatedKey state:true. 
   209 
   191 
   210     xlatedKey := device translateKey:untranslatedKey.
   192     xlatedKey := aView device translateKey:untranslatedKey.
   211     xlatedKey notNil ifTrue:[
   193     xlatedKey notNil ifTrue:[
   212         WindowEvent
   194         WindowEvent
   213           sendEvent:#keyPress:x:y:
   195           sendEvent:#keyPress:x:y:
   214           arguments:(Array with:xlatedKey with:x with:y)
   196           arguments:(Array with:xlatedKey with:x with:y)
   215           view:aView
   197           view:aView
   216     ]
   198     ]
   217 
   199 
   218     "Created: 24.11.1995 / 19:17:23 / cg"
   200     "Created: 24.11.1995 / 19:17:23 / cg"
   219     "Modified: 25.11.1995 / 10:21:26 / cg"
   201     "Modified: 28.5.1996 / 18:41:54 / cg"
   220 !
   202 !
   221 
   203 
   222 keyRelease:untranslatedKey x:x y:y view:aView
   204 keyRelease:untranslatedKey x:x y:y view:aView
   223     "forward a key-release event for some view"
   205     "forward a key-release event for some view"
   224 
   206 
   225     |xlatedKey|
   207     |xlatedKey|
   226 
   208 
   227     self key:untranslatedKey state:false. 
   209     self key:untranslatedKey state:false. 
   228 
   210 
   229     xlatedKey := device translateKey:untranslatedKey.
   211     xlatedKey := aView device translateKey:untranslatedKey.
   230     xlatedKey notNil ifTrue:[
   212     xlatedKey notNil ifTrue:[
   231         WindowEvent
   213         WindowEvent
   232             sendEvent:#keyRelease:x:y:
   214             sendEvent:#keyRelease:x:y:
   233             arguments:(Array with:xlatedKey with:x with:y)
   215             arguments:(Array with:xlatedKey with:x with:y)
   234             view:aView
   216             view:aView
   235     ]
   217     ]
   236 
   218 
   237     "Created: 24.11.1995 / 19:17:50 / cg"
   219     "Created: 24.11.1995 / 19:17:50 / cg"
   238     "Modified: 25.11.1995 / 10:21:37 / cg"
   220     "Modified: 28.5.1996 / 18:41:49 / cg"
   239 !
   221 !
   240 
   222 
   241 mappedView:aView
   223 mappedView:aView
   242     "forward a mapped event for some view"
   224     "forward a mapped event for some view"
   243 
   225 
   331 ! !
   313 ! !
   332 
   314 
   333 !SynchronousWindowSensor class methodsFor:'documentation'!
   315 !SynchronousWindowSensor class methodsFor:'documentation'!
   334 
   316 
   335 version
   317 version
   336     ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.6 1996-04-25 16:42:15 cg Exp $'
   318     ^ '$Header: /cvs/stx/stx/libview/SynchronousWindowSensor.st,v 1.7 1996-05-28 16:43:12 cg Exp $'
   337 ! !
   319 ! !