class_docstr: BaseCanvasBackend(vispy_canvas, capability, context_type)
  
  Abstract class that provides an interface between backends and Canvas.
  Each backend must implement a subclass of CanvasBackend, and
  implement all its _vispy_xxx methods. Also, a backend must
  make sure to generate the following events: 'initialize', 'resize',
  'draw', 'mouse_press', 'mouse_release', 'mouse_move',
  'mouse_wheel', 'key_press', 'key_release'. When a backend detects
  that the canvas should be closed, the backend should call
  'self._vispy_canvas.close', because the close event is handled within
  the canvas itself.
class_docstr_tok: ["BaseCanvasBackend","(","vispy_canvas",",","capability",",","context_type",")","Abstract","class","that","provides","an","interface","between","backends","and","Canvas",".","Each","backend","must","implement","a","subclass","of","CanvasBackend",",","and","implement","all","its","_vispy_xxx","methods",".","Also",",","a","backend","must","make","sure","to","generate","the","following","events",":","'initialize","'",",","'resize","'",",","'draw","'",",","'mouse_press","'",",","'mouse_release","'",",","'mouse_move","'",",","'mouse_wheel","'",",","'key_press","'",",","'key_release","'",".","When","a","backend","detects","that","the","canvas","should","be","closed",",","the","backend","should","call","'self._vispy_canvas.close","'",",","because","the","close","event","is","handled","within","the","canvas","itself","."]
code: def _vispy_detect_double_click(self, ev, **kwargs):
      # Called on every mouse_press or mouse_release, and calls
      # _vispy_mouse_double_click if a double-click is calculated.
      # Should be overridden with an empty function on backends which
      # natively support double-clicking.
  
      dt_max = 0.3  # time in seconds for a double-click detection
  
      lastev = self._vispy_mouse_data["last_mouse_press"]
  
      if lastev is None:
          self._vispy_mouse_data["last_mouse_press"] = ev
          return
  
      assert lastev.type == "mouse_press"
      assert ev.type == "mouse_press"
  
      # For a double-click to be detected, the button should be the same,
      # the position should be the same, and the two mouse-presses should
      # be within dt_max.
      if (
          (ev.time - lastev.time <= dt_max)
          & (lastev.pos[0] - ev.pos[0] == 0)
          & (lastev.pos[1] - ev.pos[1] == 0)
          & (lastev.button == ev.button)
      ):
          self._vispy_mouse_double_click(**kwargs)
  
      self._vispy_mouse_data["last_mouse_press"] = ev
  
imports: from ..util import SimpleBunch
  import time
  from timeit import default_timer
label_desc: Use image node_id 23 for calling the BaseCanvasBackend obj's underlying member method code with example usage: obj._vispy_detect_double_click(ev) without return types