class: EventMonitor
authorStefan Vogel <sv@exept.de>
Thu, 20 Mar 2014 13:53:40 +0100
changeset 14149 e248bf1390a0
parent 14148 5e6a841c980f
child 14150 0f1b5996c9bd
class: EventMonitor
EventMonitor.st
--- a/EventMonitor.st	Thu Mar 20 10:37:30 2014 +0100
+++ b/EventMonitor.st	Thu Mar 20 13:53:40 2014 +0100
@@ -1,6 +1,6 @@
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
-	      All Rights Reserved
+              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
@@ -12,18 +12,18 @@
 "{ Package: 'stx:libtool' }"
 
 ApplicationModel subclass:#EventMonitor
-	instanceVariableNames:'outputSelector'
-	classVariableNames:''
-	poolDictionaries:''
-	category:'Monitors-ST/X'
+        instanceVariableNames:'outputSelector'
+        classVariableNames:''
+        poolDictionaries:''
+        category:'Monitors-ST/X'
 !
 
 View subclass:#EventMonitorView
-	instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents
-		showTimestamp'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:EventMonitor
+        instanceVariableNames:'outputStream labelHolder showButtonMotion showFocusEvents
+                showTimestamp'
+        classVariableNames:''
+        poolDictionaries:''
+        privateIn:EventMonitor
 !
 
 !EventMonitor class methodsFor:'documentation'!
@@ -31,7 +31,7 @@
 copyright
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
-	      All Rights Reserved
+              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
@@ -48,7 +48,7 @@
 
     You can use this to check your keyboard mappings, for example.
     start with:
-	EventMonitor open
+        EventMonitor open
     and watch the output on the xterm/console.
 "
 ! !
@@ -82,26 +82,26 @@
 
     ^
      #(FullSpec
-	name: windowSpec
-	window:
+        name: windowSpec
+        window:
        (WindowSpec
-	  label: 'EventMonitor'
-	  name: 'EventMonitor'
-	  min: (Point 100 100)
-	  bounds: (Rectangle 0 0 300 300)
-	  menu: mainMenu
-	)
-	component:
+          label: 'EventMonitor'
+          name: 'EventMonitor'
+          min: (Point 100 100)
+          bounds: (Rectangle 0 0 300 300)
+          menu: mainMenu
+        )
+        component:
        (SpecCollection
-	  collection: (
-	   (NonScrollableArbitraryComponentSpec
-	      name: 'eventMonitorView'
-	      layout: (LayoutFrame 0 0 0 0 0 1 0 1)
-	      component: EventMonitorView
-	    )
-	   )
+          collection: (
+           (NonScrollableArbitraryComponentSpec
+              name: 'eventMonitorView'
+              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+              component: EventMonitorView
+            )
+           )
 
-	)
+        )
       )
 ! !
 
@@ -123,111 +123,111 @@
 
     ^
      #(Menu
-	(
-	 (MenuItem
-	    label: 'File'
-	    translateLabel: true
-	    submenu:
-	   (Menu
-	      (
-	       (MenuItem
-		  label: 'Open Modal Box'
-		  itemValue: openModalBox
-		  translateLabel: true
-		)
-	       (MenuItem
-		  label: 'Exit'
-		  itemValue: closeRequest
-		  translateLabel: true
-		)
-	       )
-	      nil
-	      nil
-	    )
-	  )
-	 (MenuItem
-	    label: 'Filter'
-	    translateLabel: true
-	    submenu:
-	   (Menu
-	      (
-	       (MenuItem
-		  label: 'Show ButtonMotion Events'
-		  itemValue: showButtonMotion:
-		  translateLabel: true
-		  indication: showButtonMotion
-		)
-	       (MenuItem
-		  label: 'Show Focus Events'
-		  itemValue: showFocusEvents:
-		  translateLabel: true
-		  indication: showFocusEvents
-		)
-	       )
-	      nil
-	      nil
-	    )
-	  )
-	 (MenuItem
-	    label: 'Output'
-	    translateLabel: true
-	    submenu:
-	   (Menu
-	      (
-	       (MenuItem
-		  label: 'Stdout'
-		  translateLabel: true
-		  choice: outputSelector
-		  choiceValue: stdout
-		)
-	       (MenuItem
-		  label: 'Transcript'
-		  translateLabel: true
-		  choice: outputSelector
-		  choiceValue: transcript
-		)
-	       (MenuItem
-		  label: '-'
-		)
-	       (MenuItem
-		  label: 'Show Timestamp'
-		  itemValue: showTimestamp:
-		  translateLabel: true
-		  indication: showTimestamp
-		)
-	       )
-	      nil
-	      nil
-	    )
-	  )
-	 (MenuItem
-	    label: 'Help'
-	    translateLabel: true
-	    startGroup: right
-	    submenu:
-	   (Menu
-	      (
-	       (MenuItem
-		  label: 'Documentation'
-		  itemValue: openDocumentation
-		  translateLabel: true
-		)
-	       (MenuItem
-		  label: '-'
-		)
-	       (MenuItem
-		  label: 'About this Application'
-		  itemValue: openAboutThisApplication
-		  translateLabel: true
-		)
-	       )
-	      nil
-	      nil
-	    )
-	  )
-	 )
-	nil
-	nil
+        (
+         (MenuItem
+            label: 'File'
+            translateLabel: true
+            submenu:
+           (Menu
+              (
+               (MenuItem
+                  label: 'Open Modal Box'
+                  itemValue: openModalBox
+                  translateLabel: true
+                )
+               (MenuItem
+                  label: 'Exit'
+                  itemValue: closeRequest
+                  translateLabel: true
+                )
+               )
+              nil
+              nil
+            )
+          )
+         (MenuItem
+            label: 'Filter'
+            translateLabel: true
+            submenu:
+           (Menu
+              (
+               (MenuItem
+                  label: 'Show ButtonMotion Events'
+                  itemValue: showButtonMotion:
+                  translateLabel: true
+                  indication: showButtonMotion
+                )
+               (MenuItem
+                  label: 'Show Focus Events'
+                  itemValue: showFocusEvents:
+                  translateLabel: true
+                  indication: showFocusEvents
+                )
+               )
+              nil
+              nil
+            )
+          )
+         (MenuItem
+            label: 'Output'
+            translateLabel: true
+            submenu:
+           (Menu
+              (
+               (MenuItem
+                  label: 'Stdout'
+                  translateLabel: true
+                  choice: outputSelector
+                  choiceValue: stdout
+                )
+               (MenuItem
+                  label: 'Transcript'
+                  translateLabel: true
+                  choice: outputSelector
+                  choiceValue: transcript
+                )
+               (MenuItem
+                  label: '-'
+                )
+               (MenuItem
+                  label: 'Show Timestamp'
+                  itemValue: showTimestamp:
+                  translateLabel: true
+                  indication: showTimestamp
+                )
+               )
+              nil
+              nil
+            )
+          )
+         (MenuItem
+            label: 'Help'
+            translateLabel: true
+            startGroup: right
+            submenu:
+           (Menu
+              (
+               (MenuItem
+                  label: 'Documentation'
+                  itemValue: openDocumentation
+                  translateLabel: true
+                )
+               (MenuItem
+                  label: '-'
+                )
+               (MenuItem
+                  label: 'About this Application'
+                  itemValue: openAboutThisApplication
+                  translateLabel: true
+                )
+               )
+              nil
+              nil
+            )
+          )
+         )
+        nil
+        nil
       )
 ! !
 
@@ -239,8 +239,8 @@
 
 outputSelector
     outputSelector isNil ifTrue:[
-	outputSelector := #transcript asValue.
-	outputSelector onChangeEvaluate:[ self outputSelectorChanged ].
+        outputSelector := #transcript asValue.
+        outputSelector onChangeEvaluate:[ self outputSelectorChanged ].
     ].
     ^ outputSelector
 !
@@ -324,7 +324,7 @@
     like xev - show events.
     You can use this to check your keyboard mappings, for example.
     start with:
-	EventMonitorView open
+        EventMonitorView open
     and watch the output on xterm.
 "
 ! !
@@ -344,10 +344,10 @@
 
     labelHolder value:nil.
     outputStream == Stdout ifTrue:[
-	labelHolder value: 'See event trace\on the standard output' withCRs.
+        labelHolder value: 'See event trace\on the standard output' withCRs.
     ].
     outputStream == Transcript ifTrue:[
-	labelHolder value: 'See event trace\on the Transcript' withCRs.
+        labelHolder value: 'See event trace\on the Transcript' withCRs.
     ].
     self invalidate.
 
@@ -401,15 +401,15 @@
 
     y := (self height - ((font heightOf:'A') * lines size)) // 2.
     lines do:[:eachLine |
-	p := (self center x - ((font widthOf:eachLine) // 2)) @ y.
-	self displayString:eachLine value x:(p x) y:(p y).
-	y := y + (font heightOf:eachLine).
+        p := (self center x - ((font widthOf:eachLine) // 2)) @ y.
+        self displayString:eachLine value x:(p x) y:(p y).
+        y := y + (font heightOf:eachLine).
     ]
 !
 
 showEventTime
     self showTimestamp ifTrue:[
-	Transcript show:(Timestamp now); show:' '.
+        Transcript show:(Timestamp now); show:' '.
     ]
 
     "Created: / 04-10-2006 / 13:08:27 / cg"
@@ -508,7 +508,7 @@
 
 dispatchEvent:event withFocusOn:focusViewOrNil delegate:doDelegate
     event isButtonMotionEvent ifTrue:[
-	self showButtonMotion ifFalse:[^ self].
+        self showButtonMotion ifFalse:[^ self].
     ].
 
 "/    Timestamp now printOn:outputStream.
@@ -574,14 +574,14 @@
     s printOn:outputStream.
 
     (key isMemberOf:Character) ifTrue:[
-	s := ' character key:' , key storeString
-	     , ' (' , key asciiValue printString , ')'.
+        s := ' character key:' , key storeString
+             , ' (' , key asciiValue printString , ')'.
     ] ifFalse:[
-	s := ' symbolic key:' , key storeString.
-	untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key.
-	untranslatedKey ~~ key ifTrue:[
-	    s := s , ' untranslated key:' , untranslatedKey storeString
-	].
+        s := ' symbolic key:' , key storeString.
+        untranslatedKey := self graphicsDevice keyboardMap keyAtValue:key ifAbsent:key.
+        untranslatedKey ~~ key ifTrue:[
+            s := s , ' untranslated key:' , untranslatedKey storeString
+        ].
     ].
     rawKey := (WindowGroup lastEventQuerySignal query) rawKey.
     s := s , ' rawKey:' , rawKey storeString.
@@ -589,9 +589,9 @@
     s printOn:outputStream.
 
     key isCharacter ifTrue:[
-	outputStream nextPutAll:' '''.
-	key asString printOn:outputStream.
-	outputStream nextPutAll:''''.
+        outputStream nextPutAll:' '''.
+        key asString printOn:outputStream.
+        outputStream nextPutAll:''''.
     ].
     outputStream cr.
 
@@ -609,20 +609,20 @@
     y printOn:outputStream.
 
     (key isMemberOf:Character) ifTrue:[
-	key codePoint <= 16rFF ifTrue:[
-	    ' character key:' printOn:outputStream.
-	    key storeString printOn:outputStream.
-	] ifFalse:[
-	    ' unicode character utf8:' printOn:outputStream.
-	    key asString utf8Encoded asByteArray hexPrintOn:outputStream.
-	].
-	' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream
+        key codePoint <= 16rFF ifTrue:[
+            ' character key:' printOn:outputStream.
+            key storeString printOn:outputStream.
+        ] ifFalse:[
+            ' unicode character utf8:' printOn:outputStream.
+            key asString utf8Encoded asByteArray hexPrintOn:outputStream.
+        ].
+        ' (' printOn:outputStream. key asciiValue printOn:outputStream. ')' printOn:outputStream
     ] ifFalse:[
-	' symbolic key:' print. key storeString printOn:outputStream.
-	untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:key.
-	untranslatedKey ~~ key ifTrue:[
-	    ' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream
-	]
+        ' symbolic key:' print. key storeString printOn:outputStream.
+        untranslatedKey := self graphicsDevice keyboardMap keyAtValue:key ifAbsent:key.
+        untranslatedKey ~~ key ifTrue:[
+            ' untranslated key:' printOn:outputStream. untranslatedKey storeString printOn:outputStream
+        ]
     ].
 
     outputStream cr
@@ -723,5 +723,6 @@
 !EventMonitor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.31 2014-03-20 09:37:30 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/EventMonitor.st,v 1.32 2014-03-20 12:53:40 stefan Exp $'
 ! !
+