code: def keypress(self, viewer, event, data_x, data_y):
          
          keyname = event.key
          chname = self.get_channel_name(viewer)
          self.logger.debug("key press (%s) in channel %s" % (
              keyname, chname))
          # TODO: keyboard accelerators to raise tabs need to be integrated into
          #   the desktop object
          if keyname == 'Z':
              self.ds.raise_tab('Zoom')
          ## elif keyname == 'T':
          ##     self.ds.raise_tab('Thumbs')
          elif keyname == 'I':
              self.ds.raise_tab('Info')
          elif keyname == 'H':
              self.ds.raise_tab('Header')
          elif keyname == 'C':
              self.ds.raise_tab('Contents')
          elif keyname == 'D':
              self.ds.raise_tab('Dialogs')
          elif keyname == 'F':
              self.build_fullscreen()
          elif keyname == 'f':
              self.toggle_fullscreen()
          elif keyname == 'm':
              self.maximize()
          elif keyname == '<':
              self.collapse_pane('left')
          elif keyname == '>':
              self.collapse_pane('right')
          elif keyname == 'n':
              self.next_channel()
          elif keyname == 'J':
              self.cycle_workspace_type()
          elif keyname == 'k':
              self.add_channel_auto()
          elif keyname == 'K':
              self.remove_channel_auto()
          elif keyname == 'f1':
              self.show_channel_names()
          ## elif keyname == 'escape':
          ##     self.reset_viewer()
          elif keyname in ('up',):
              self.prev_img()
          elif keyname in ('down',):
              self.next_img()
          elif keyname in ('left',):
              self.prev_channel()
          elif keyname in ('right',):
              self.next_channel()
          return True
docs: Key press event in a channel window.