I have a game with a navigable map. You can select items on the map, but you can also click and drag to maneuver around the map. I don't want to accidentally select items while navigating the map, so I have a variable called
dragged that indicates whether or not the mouse has been dragged after being clicked. When the mouse is released over an object on the map, it is only selected if
dragged == false
Here's the conundrum. This works perfectly EXCEPT for the fact that if I move the mouse even one pixel after clicking then I can't select on any map items. There has to be no mouse movement whatsoever. My players aren't robots, so this isn't ideal.
Here is the script that sets dragged to true:
if event is InputEventMouseMotion:
dragged = true
Is there any way to set dragged to true ONLY if
InputEventMouseMotion occurs over a set duration, number of frames, or distance in pixels?