class_docstr: Manager for actions triggered by user interactions (key press, toolbar
  clicks, ...) on a Figure.
  
  Attributes
  ----------
  figure : `.Figure`
  keypresslock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the `canvas` key_press_event is locked.
  messagelock : `~matplotlib.widgets.LockDraw`
      `.LockDraw` object to know if the message is available to write.
class_docstr_tok: ["Manager","for","actions","triggered","by","user","interactions","(","key","press",",","toolbar","clicks",",","...",")","on","a","Figure",".","Attributes","--","--","--","--","--","figure",":","`",".Figure","`","keypresslock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","`","canvas","`","key_press_event","is","locked",".","messagelock",":","`","~matplotlib.widgets.LockDraw","`","`",".LockDraw","`","object","to","know","if","the","message","is","available","to","write","."]
code: def __init__(self, figure=None):
      self._key_press_handler_id = None
  
      self._tools = {}
      self._keys = {}
      self._toggled = {}
      self._callbacks = cbook.CallbackRegistry()
  
      # to process keypress event
      self.keypresslock = widgets.LockDraw()
      self.messagelock = widgets.LockDraw()
  
      self._figure = None
      self.set_figure(figure)
  
imports: from matplotlib import _api, backend_tools, cbook, widgets
label_desc: Use image node_id 1 to create a new ToolManager object  with example: obj = ToolManager(figure)