def getkeypress(self):
        u'''Return next key press event from the queue, ignoring others.'''
        while 1:
            e = self.get()
            if e.type == u'KeyPress' and e.keycode not in key_modifiers:
                log(u"console.getkeypress %s"%e)
                if e.keyinfo.keyname == u'next':
                    self.scroll_window(12)
                elif e.keyinfo.keyname == u'prior':
                    self.scroll_window(-12)
                else:
                    return e
            elif ((e.type == u'KeyRelease') and 
                  (e.keyinfo == KeyPress('S', False, True, False, 'S'))):
                log(u"getKeypress:%s,%s,%s"%(e.keyinfo, e.keycode, e.type))
                return e