mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 16:59:56 +01:00
A host app that serves the control channel can now run a whole drag
from one request instead of composing ui.click with hold, ui.move steps
and ui.release itself.
- synthetic::Drag reads {from, to, button?, steps?, modifiers}. from and
to are point objects {x?, y?, coordinates?, page?}, each in its own
space; errors inside one name it (from.x ...). steps runs from 1 to
MAX_DRAG_STEPS (200), default DRAG_STEPS (12).
- Drag::inject resolves both points before it queues anything, then
queues the press at from, the moves to to in even steps (the last one
lands on to) and the release at to. The modifiers stay held through
the release and are let go afterwards unless other input stays held,
as after ui.click.
- input_method dispatches ui.drag, so its reply waits for the release.
- The crate README, docs/craft-framework.md and docs/porting.md list it.
Tests: a drag with a document-point end presses at from, makes one move
per step towards to, releases at to and leaves nothing held; a drag
keeps its modifiers while a held key stays down; a drag whose end
cannot be placed queues no press; bad drag params join the refused-input
table.