parameters: (self, event)
docstring: Handles the ``wx.EVT_CHAR`` event for :class:`TreeTextCtrl`.
  
          :param `event`: a :class:`KeyEvent` event to be processed.
docstring_summary: Handles the ``wx.EVT_CHAR`` event for :class:`TreeTextCtrl`.
docstring_tokens: Handles the wx . EVT_CHAR event for : class : TreeTextCtrl .
function: def OnChar(self, event):
          """
          Handles the ``wx.EVT_CHAR`` event for :class:`TreeTextCtrl`.
  
          :param `event`: a :class:`KeyEvent` event to be processed.
          """
  
          keycode = event.GetKeyCode()
          shiftDown = event.ShiftDown()
  
          if keycode in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
              if shiftDown:
                  event.Skip()
              else:
                  self._aboutToFinish = True
                  self.SetValue(self._currentValue)
                  # Notify the owner about the changes
                  self.AcceptChanges()
                  # Even if vetoed, close the control (consistent with MSW)
                  wx.CallAfter(self.Finish)
  
          elif keycode == wx.WXK_ESCAPE:
              self.StopEditing()
  
          else:
              event.Skip()
function_tokens: def OnChar ( self , event ) : keycode = event . GetKeyCode ( ) shiftDown = event . ShiftDown ( ) if keycode in [ wx . WXK_RETURN , wx . WXK_NUMPAD_ENTER ] : if shiftDown : event . Skip ( ) else : self . _aboutToFinish = True self . SetValue ( self . _currentValue ) # Notify the owner about the changes self . AcceptChanges ( ) # Even if vetoed, close the control (consistent with MSW) wx . CallAfter ( self . Finish ) elif keycode == wx . WXK_ESCAPE : self . StopEditing ( ) else : event . Skip ( )