diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/guide.md b/docs/guide.md index 888e4ab..61583b1 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -219,8 +219,13 @@ remain available for commands; input methods may consume keys while composing. Pointer events use the `YASL_EVENT_POINTER_*` types and share `event.pointer`, with `device` distinguishing mouse, touch, pen, and eraser. `POINTER_DOWN` and `POINTER_UP` carry a `YASL_BUTTON_*` value: `PRIMARY` is the left button, pen tip, -or touch contact. Track those transitions; other types leave `button` -meaningless. `POINTER_MOTION` reports `delta`, the device-pixel movement since +or touch contact. Other types leave `button` meaningless. Every pointer event +also carries `buttons`, a `YASL_BUTTON_BIT()` mask of the buttons held after +that event, tracked from the queue's down and up events. Use it to tell a drag +from a hover. `YASL_EVENT_INPUT_RESET` clears the mask. On Wayland, +`POINTER_LEAVE` also clears it, because the compositor sends leave during a +press only when it takes the pointer away. X11 and Cocoa keep the press across +leave and still deliver the release. `POINTER_MOTION` reports `delta`, the device-pixel movement since the previous sample, which restarts from zero after enter, leave, or reset. `yasl_surface_set_pointer_mode()` with `YASL_POINTER_RELATIVE` hides and locks the cursor while the surface is focused; motion then carries unbounded `delta` and |
