EvMonitor.st
author claus
Thu, 10 Aug 1995 15:14:54 +0200
changeset 110 570a38362ae1
parent 73 e332d9c71624
child 111 b4ef3e799345
permissions -rw-r--r--
.

"
 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.
"

'From Smalltalk/X, Version:1.4 on 19-Jul-91 at 18:34:01'!

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

EventMonitor comment:'
COPYRIGHT (c) 1991 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libtool/Attic/EvMonitor.st,v 1.7 1995-08-10 13:14:09 claus Exp $
'!

!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.
"
!

version
"
$Header: /cvs/stx/stx/libtool/Attic/EvMonitor.st,v 1.7 1995-08-10 13:14:09 claus Exp $
$Revision: 1.7 $
"
!

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:'initialization'!

initialize
    |l|

    super initialize.

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

!EventMonitor methodsFor:'events'!

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 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 print
    ].

    '' 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
!

buttonMotion:button x:x y:y
    'buttonMotion x:' print. x print. ' y:' print. y print.
    ' button:' print. button 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
!

mapped
    'mapped' printNL
!

unmapped
    'unmapped' printNL
!

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

!EventMonitor methodsFor:'realization'!

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