EventMonitor.st
author Claus Gittinger <cg@exept.de>
Wed, 29 May 1996 13:23:56 +0200
changeset 581 d1a1ae9d49e4
parent 433 703d84558f6f
child 640 7608b07af7bb
permissions -rw-r--r--
removed old non-thread support

"
 COPYRIGHT (c) 1991 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

StandardSystemView subclass:#EventMonitor
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Tools'
!

!EventMonitor class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1991 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    like xev - show events.
    You can use this to check your keyboard mappings, for example.
    start with: 
	EventMonitor open
    and watch the output on xterm.
"
! !

!EventMonitor class methodsFor:'defaults'!

defaultExtent
    ^ 200 @ 200
!

defaultLabel
    ^ 'Event Monitor'
! !

!EventMonitor methodsFor:'events'!

buttonMotion:state x:x y:y
    'buttonMotion x:' print. x print. ' y:' print. y print.
    ' state:' print. state printNL
!

buttonPress:button x:x y:y
    'buttonPress x:' print. x print. ' y:' print. y print.
    ' button:' print. button printNL
!

buttonRelease:button x:x y:y
    'buttonRelease x:' print. x print. ' y:' print. y print.
    ' button:' print. button printNL
!

configureX:x y:y width:newWidth height:newHeight
    'configure x:' print. x print. ' y:' print. y print.
    ' width:' print. newWidth print. ' height:' print. newHeight printNL.

    ^ super configureX:x y:y width:newWidth height:newHeight

    "Modified: 7.3.1996 / 15:05:15 / cg"
!

focusIn
    'focusIn' printNL.

    "Created: 7.3.1996 / 15:06:18 / cg"
!

focusOut
    'focusOut' printNL.

    "Created: 7.3.1996 / 15:06:21 / cg"
!

keyPress:key x:x y:y
    'KeyPress x:' print. x print. ' y:' print. y print.
    (key isMemberOf:Character) ifTrue:[
        ' character key:' print. key print.
        ' (' print. key asciiValue print. ')' print
    ] ifFalse:[
        ' symbolic key:' print. key storeString print
    ].

    '' printNL
!

keyRelease:key x:x y:y
    'KeyRelease x:' print. x print. ' y:' print. y print.
    (key isMemberOf:Character) ifTrue:[
        ' character key:' print. key print.
        ' (' print. key asciiValue print. ')' print
    ] ifFalse:[
        ' symbolic key:' print. key storeString print
    ].

    '' printNL
!

mapped
    'mapped' printNL
!

pointerEnter:state x:x y:y
    'pointerEnter x:' print. x print. ' y:' print. y print.
    ' state:' print. state printNL
!

pointerLeave:state 
    'pointerLeave state:' print. state printNL
!

unmapped
    'unmapped' printNL
!

visibilityChange:how
    'visibilityChange:' print. how storeString printNL
! !

!EventMonitor methodsFor:'initialization'!

initialize
    |l|

    super initialize.

    l := Label label:'see event trace\on standard output' withCRs in:self.
    l borderWidth:0
! !

!EventMonitor methodsFor:'realization'!

initEvents
"/    self enableButtonEvents.
"/    self enableButtonMotionEvents.
    self enableMotionEvents.
    self enableKeyReleaseEvents.
    self enableEnterLeaveEvents.
    self enableFocusEvents.
    self enableEvent:#visibilityChange

    "Modified: 7.3.1996 / 15:06:42 / cg"
! !

!EventMonitor class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.11 1996-03-07 14:07:24 cg Exp $'
! !