<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">'From Squeak4.4 of 1 March 2013 [latest update:
      #12489] on 23 July 2013 at 7:17:36 pm'!<br>
      Morph subclass: #TimsAppMorph<br>
          instanceVariableNames: ''<br>
          classVariableNames: ''<br>
          poolDictionaries: ''<br>
          category: 'Morphic-Kernel'!<br>
      !TimsAppMorph commentStamp: 'raa 7/23/2013 19:08' prior: 0!<br>
      TimsAppMorph new openInWorld!<br>
      <br>
      <br>
      !TimsAppMorph methodsFor: 'as yet unclassified' stamp: 'raa
      7/23/2013 19:16'!<br>
      handleListenEvent: anEvent<br>
          <br>
          anEvent hand keyboardFocus ifNotNil: [^self].<br>
          anEvent isKeyboard ifFalse: [^self].<br>
          <br>
          "insert your code here to handle key up/down/stroke as you
      wish"<br>
          <br>
          Transcript show: 'I could handle: ', anEvent  asString; cr<br>
          ! !<br>
      <br>
      !TimsAppMorph methodsFor: 'as yet unclassified' stamp: 'raa
      7/23/2013 19:08'!<br>
      initialize<br>
      <br>
          super initialize.<br>
          self extent: 60@60.<br>
          self color: Color paleBlue.<br>
          ActiveHand addKeyboardListener: self.! !<br>
      <br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 7/23/13 6:41 PM, tim Rowledge wrote:<br>
    </div>
    <blockquote
      cite="mid:563F4CE5-0418-4692-A52A-DFE8685836B7@rowledge.org"
      type="cite">
      <pre wrap="">I'm trying to get an idea of how to handle keyboard events when there is no keyboard focus; this is for dealing with  general application commands like 'start', 'stop', 'explode', etc.

I *think* it looks like I might need a listener object added to the handmorph but I don't see how to check if the focus is nil as part of that path. An alternative appears to be something to do with the owner of the hand… maybe?
I've spent too long wandering a twisty maze of messages and as a result, got eaten by a Grue. Explanations of how this all works would be appreciated, whether actual or pointers to already written doc. For example, why do all the implementors of #handleFocusEvent: except Morph use both #processEvent: and handleEvent: when it looks like #processEvent also sends #handleEvent: ? I hope there are intelligible explanations out there...

tim
--
tim Rowledge; <a class="moz-txt-link-abbreviated" href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a class="moz-txt-link-freetext" href="http://www.rowledge.org/tim">http://www.rowledge.org/tim</a>
Strange OpCodes: ETO: Emulate Toaster Oven




</pre>
    </blockquote>
    <br>
  </body>
</html>