Skip to content

Commit fc4f62e

Browse files
committed
Improve documentation
1 parent f123e85 commit fc4f62e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/source/events.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Interactions
22
============
33

4-
Using built-in events
4+
Built-in mouse events
55
---------------------
66

7-
The following built-in mouse events are supported: ``mouse_down``, ``mouse_move``, ``mouse_up`` and ``mouse_out``.
7+
The following built-in mouse events are supported: ``mouse_down``, ``mouse_move``, ``mouse_up`` and ``mouse_out``. You can define Python callback functions that will be called whenever those mouse events occur, using the ``on_mouse_down``, ``on_mouse_move``, ``on_mouse_up`` and ``on_mouse_out`` methods.
8+
9+
Those methods take a callback function as single argument, this callback function must take two positional arguments that are the ``x`` and ``y`` pixel coordinates where the mouse was during the event.
810

911
.. code:: Python
1012
@@ -23,8 +25,8 @@ The following built-in mouse events are supported: ``mouse_down``, ``mouse_move`
2325
.. note::
2426
Please open an issue or a Pull Request if you want more events to be supported by ipycanvas
2527

26-
Using ipyevents
27-
---------------
28+
ipyevents
29+
---------
2830

2931
If built-in events are not enough for your use case, you can use `ipyevents <https://github.com/mwcraig/ipyevents>`_ which provides mouse and keyboard events.
3032

0 commit comments

Comments
 (0)