code: def on_key(self, event):
          
  
          if self.main_window.grid.actions.pasting and \
             event.GetKeyCode() == wx.WXK_ESCAPE:
              self.aborted = True
  
          event.Skip()
docs: Sets aborted state if escape is pressed