Esempio n. 1
0
 def keypress(self, size, k):
     if self.prompting:
         if k == "esc":
             self.prompt_done()
         elif self.onekey:
             if k == "enter":
                 self.prompt_done()
             elif k in self.onekey:
                 self.prompt_execute(k)
         elif k == "enter":
             self.prompt_execute(self._w.get_edit_text())
         else:
             if common.is_keypress(k):
                 self._w.keypress(size, k)
             else:
                 return k
Esempio n. 2
0
 def keypress(self, size, k):
     if self.prompting:
         if k == "esc":
             self.prompt_done()
         elif self.onekey:
             if k == "enter":
                 self.prompt_done()
             elif k in self.onekey:
                 self.prompt_execute(k)
         elif k == "enter":
             self.prompt_execute(self._w.get_edit_text())
         else:
             if common.is_keypress(k):
                 self._w.keypress(size, k)
             else:
                 return k