Allow for double click to happen even if the second click is a slight bit off

On touch devices it is hard to do two clicks on the exact same position, which makes double clicking hard. This patch would make so that a double click is triggered when two mouse clicks occur within 500 milli seconds and closer than 50 pixels together.