code: def _sendMouseEvent(ev, x, y, dwData=0):
      
      assert x != None and y != None, 'x and y cannot be set to None'
      # TODO: ARG! For some reason, SendInput isn't working for mouse events. I'm switching to using the older mouse_event win32 function.
      #mouseStruct = MOUSEINPUT()
      #mouseStruct.dx = x
      #mouseStruct.dy = y
      #mouseStruct.mouseData = ev
      #mouseStruct.time = 0
      #mouseStruct.dwExtraInfo = ctypes.pointer(ctypes.c_ulong(0)) # according to https://stackoverflow.com/questions/13564851/generate-keyboard-events I can just set this. I don't really care about this value.
      #inputStruct = INPUT()
      #inputStruct.mi = mouseStruct
      #inputStruct.type = INPUT_MOUSE
      #ctypes.windll.user32.SendInput(1, ctypes.pointer(inputStruct), ctypes.sizeof(inputStruct))
  
      width, height = _size()
      convertedX = 65536 * x // width + 1
      convertedY = 65536 * y // height + 1
      ctypes.windll.user32.mouse_event(ev, ctypes.c_long(convertedX), ctypes.c_long(convertedY), dwData, 0)
docs: The helper function that actually makes the call to the mouse_event()
      win32 function.
  
      Args:
        ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
        constants for this argument.
        x (int): The x position of the mouse event.
        y (int): The y position of the mouse event.
        dwData (int): The argument for mouse_event()'s dwData parameter. So far
          this is only used by mouse scrolling.
  
      Returns:
        None