class_docstr: This is the matplotlib based GUI for a single analysis
  It assumes the analysis is simple image data (this could be abstracted)
class_docstr_tok: ["This","is","the","matplotlib","based","GUI","for","a","single","analysis","It","assumes","the","analysis","is","simple","image","data","(","this","could","be","abstracted",")"]
docstr: Handle the keyboard shortcuts
docstr_tok: ["Handle","the","keyboard","shortcuts"]
code: def on_keypress(self, event):
      """Handle the keyboard shortcuts"""
      if event.key in ["q", "Q", "escape"]:
          self.quit()
      update = False
      if event.key in ["i", "I"]:
          self.selection_mask = ~self.selection_mask
          update = True
      if event.key in ["a", "A"]:
          self.selection_mask.fill(True)
          update = True
      if event.key in ["d", "D"]:
          self.selection_mask.fill(False)
          update = True
      if update:
          self.refresh_selection()
          return
  
      self.draw_state = DrawingCursors.get_drawstate(event.key)
      self.setCursor(DrawingCursors.cursors[self.draw_state])
      self.set_selector(self.draw_state[1])
  
imports: import io
  from enum import Enum
  import numpy
  import matplotlib.pyplot
  import matplotlib.style
  from matplotlib.widgets import RectangleSelector, LassoSelector, EllipseSelector, PolygonSelector
  from matplotlib.path import Path
  from matplotlib.backends.backend_qt5agg import FigureCanvas
  from matplotlib.figure import Figure
  from PyQt5 import QtWidgets, QtCore
  from cursors import DrawingCursors, DrawingShape, DrawingMode
label_desc: Use image node_id 12 for calling the EmbeddingGui obj's underlying member method code with example usage: obj.on_keypress(event) without return types