ScriptUI: a drag keeps its control past the window edge; MouseEvent.buttons (#2584)

A drag that started on a script control stopped at the window edge:
moves outside were dropped and a release outside never reached the
control. While a button is held, the control it was pressed on now gets
the moves (with screen and control-relative coordinates) and the
release, wherever the pointer is, as in After Effects. Every MouseEvent
also carries buttons (held: 1 left, 2 right, 4 middle), so a handler can
tell a drag from a hover; scriptui.mouse accepts it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-30 07:04:18 +07:00
co-authored by Claude Opus 5.5
parent 9250a30b37
commit 01f92b04c5
5 changed files with 66 additions and 10 deletions
+1
View File
@@ -755,6 +755,7 @@ pub(crate) fn mouse(s: &mut Session, p: &Value) -> Result<Value> {
"screenX": num("screenX", -FAR, FAR, 0.0),
"screenY": num("screenY", -FAR, FAR, 0.0),
"button": num("button", 0.0, 2.0, 0.0).round(),
"buttons": num("buttons", 0.0, 7.0, 0.0).round(),
"detail": num("detail", 0.0, 1000.0, clicks).round(),
"altKey": flag("altKey"),
"ctrlKey": flag("ctrlKey"),