Skip to content

Commit 6726041

Browse files
authored
Better spcify event spec (#118)
1 parent d1e69fd commit 6726041

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

jupyter_rfb/events.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Events are simple dict objects containing at least the key `event_type`.
55
Additional keys provide more information regarding the event.
66
7-
*Last update: 24-10-2023*
7+
*Last update: 09-05-2025*
88
99
Event types
1010
-----------
@@ -125,9 +125,27 @@
125125
Event capturing
126126
---------------
127127
128-
Since jupyter_rfb represents a widget in the browser, some events only
129-
work when it has focus (having received a pointer down). This applies
130-
to the *key_down*, *key_up*, and *wheel* events.
128+
The *pointer_move* event only occurs when the pointer is over the widget,
129+
unless a button is down (i.e. dragging). The *pointer_down* event can only
130+
occur inside the widget, the *pointer_up* can occur outside of the widget.
131+
132+
Some events only work when the widget has focus within the application
133+
(i.e. having received a pointer down).
134+
This applies to the *key_down*, *key_up*, and *wheel* events.
135+
136+
137+
Application focus
138+
-----------------
139+
140+
(In the case of ``jupyter_rfb``, the 'application' typically means the browser.)
141+
142+
* When the application does not have focus, it does not emit any pointer events.
143+
* When the application loses focus, a *pointer_leave* event is emitted, and
144+
also a *pointer_up* event if a button is currently down.
145+
* When the application regains focus, an enter event is emitted if the pointer
146+
if over the canvas. This not may happen until the pointer is moved.
147+
* If the application regained focus by clicking on the canvas, that click does
148+
not result in pointer events (down, move, nor up).
131149
132150
133151
Event throttling

0 commit comments

Comments
 (0)