From 51534a4755306dcdc4e958e88ef65a1783caa0cd Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 14 Mar 2024 13:12:13 -0400 Subject: [PATCH] improve mouse wheel docs --- py5_docs/Reference/api_en/Py5MouseEvent_get_count.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/py5_docs/Reference/api_en/Py5MouseEvent_get_count.txt b/py5_docs/Reference/api_en/Py5MouseEvent_get_count.txt index ff4aeed4f..e673c9d6f 100644 --- a/py5_docs/Reference/api_en/Py5MouseEvent_get_count.txt +++ b/py5_docs/Reference/api_en/Py5MouseEvent_get_count.txt @@ -10,6 +10,8 @@ get_count() -> int @@ description Get the number of mouse clicks. This will be 1 for a single mouse click and 2 for a double click. The value can be much higher if the user clicks fast enough. +This method also responds to the mouse wheel. It will be 1 when the mouse wheel is rotating down and -1 when the mouse wheel is rotating up. + @@ example def setup(): py5.size(200, 200, py5.P2D) @@ -22,3 +24,8 @@ def draw(): def mouse_clicked(e): py5.println('mouse click count:', e.get_count()) + + +def mouse_wheel(e): + direction = "down" if e.get_count() == 1 else "up" + py5.println(f"mouse wheel rotating {direction}")