-
-
Notifications
You must be signed in to change notification settings - Fork 212
Closed
Labels
$ bounty $Please suggest a price range πPlease suggest a price range πenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
The following functions, get_double_click_interval_seconds and get_double_click_distance_pixels in utils.py only work for Windows and Mac platforms. The goal is to add Linux support as well.
if hasattr(get_double_click_interval_seconds, "override_value"):
return get_double_click_interval_seconds.override_value
if sys.platform == "darwin":
from AppKit import NSEvent
return NSEvent.doubleClickInterval()
elif sys.platform == "win32":
# https://stackoverflow.com/a/31686041/95989
from ctypes import windll
return windll.user32.GetDoubleClickTime() / 1000
else:
raise Exception(f"Unsupported {sys.platform=}")
def get_double_click_distance_pixels():
if sys.platform == "darwin":
# From https://developer.apple.com/documentation/appkit/nspressgesturerecognizer/1527495-allowablemovement:
# The default value of this property is the same as the
# double-click distance.
# TODO: do this more robustly; see:
# https://forum.xojo.com/t/get-allowed-unit-distance-between-doubleclicks-on-macos/35014/7
from AppKit import NSPressGestureRecognizer
return NSPressGestureRecognizer.new().allowableMovement()
elif sys.platform == "win32":
import win32api
import win32con
x = win32api.GetSystemMetrics(win32con.SM_CXDOUBLECLK)
y = win32api.GetSystemMetrics(win32con.SM_CYDOUBLECLK)
if x != y:
logger.warning(f"{x=} != {y=}")
return max(x, y)
else:
raise Exception(f"Unsupported {sys.platform=}")```
abrichr
Metadata
Metadata
Assignees
Labels
$ bounty $Please suggest a price range πPlease suggest a price range πenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed