code: def _inputLoop(self):
          
          
          # Switch statement for handling "special" characters
          actionChars = {self.EXIT_CHARACTER: self._exit,
                         self.EXIT_CHARACTER_2: self._exit,
                          
                         console.CURSOR_LEFT: self._cursorLeft,
                         console.CURSOR_RIGHT: self._cursorRight,
                         console.CURSOR_UP: self._cursorUp,
                         console.CURSOR_DOWN: self._cursorDown,
                          
                         '\n': self._doConfirmInput,
                         '\t': self._doCommandCompletion,
                         
                         self.CTRL_Z_CHARACTER: self._handleCtrlZ,
                         self.ESC_CHARACTER: self._handleEsc,
                         
                         self.BACKSPACE_CHARACTER: self._handleBackspace,
                         console.DELETE: self._handleDelete,
                         console.HOME: self._handleHome,
                         console.END: self._handleEnd}
  
          try:
              while self.alive:
                  try:
                      c = console.getkey()
                  except KeyboardInterrupt:
                      c = serial.to_bytes([3])
                  if c in actionChars:
                      # Handle character directly                    
                      actionChars[c]()
                  elif len(c) == 1 and self._isPrintable(c):
                      self.inputBuffer.insert(self.cursorPos, c)
                      self.cursorPos += 1
                      self._refreshInputPrompt()
                  #else:
                  #    for a in c:
                  #        print('GOT:',a,'(',ord(a),')')
          except:
              self.alive = False
              raise
docs: Loop and copy console->serial until EXIT_CHARCTER character is found.