From d50c99f238249660534ba0c4aec197a76c70d4e1 Mon Sep 17 00:00:00 2001 From: Randolf Jung Date: Mon, 4 Mar 2024 15:04:56 +0100 Subject: [PATCH] Update CDDL to updated pointer spec --- index.bs | 148 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 114 insertions(+), 34 deletions(-) diff --git a/index.bs b/index.bs index d7a00a23..085c16fb 100644 --- a/index.bs +++ b/index.bs @@ -10270,24 +10270,64 @@ specified sequence of user input actions. input.KeyUpAction ) - input.PointerSourceActions = { - type: "pointer", - id: text, - ? parameters: input.PointerParameters, - actions: [*input.PointerSourceAction] + input.PointerSourceActions = ( + input.MouseSourceActions / + input.TouchSourceActions / + input.PenSourceActions + ) + + input.MouseSourceActions = { + type: "pointer", + id: text, + ? parameters: input.MouseSourceParameters, + actions: [*input.MouseSourceAction] + } + + input.MouseSourceParameters = { + ? pointerType: "mouse" } - input.PointerType = "mouse" / "pen" / "touch" + input.MouseSourceAction = ( + input.PauseAction / + input.MouseDownAction / + input.MouseUpAction / + input.MouseMoveAction + ) + + input.TouchSourceActions = { + type: "pointer", + id: text, + parameters: input.TouchSourceParameters, + actions: [*input.TouchSourceAction] + } - input.PointerParameters = { - ? pointerType: input.PointerType .default "mouse" + input.TouchSourceParameters = { + pointerType: "touch" } - input.PointerSourceAction = ( + input.TouchSourceAction = ( input.PauseAction / - input.PointerDownAction / - input.PointerUpAction / - input.PointerMoveAction + input.TouchDownAction / + input.TouchUpAction / + input.TouchMoveAction + ) + + input.PenSourceActions = { + type: "pointer", + id: text, + parameters: input.PenSourceParameters, + actions: [*input.PenSourceAction] + } + + input.PenSourceParameters = { + pointerType: "pen" + } + + input.PenSourceAction = ( + input.PauseAction / + input.PenDownAction / + input.PenUpAction / + input.PenMoveAction ) input.WheelSourceActions = { @@ -10316,48 +10356,88 @@ specified sequence of user input actions. value: text } - input.PointerUpAction = { + input.MouseDownAction = { + type: "pointerDown", + button: js-uint + } + + input.MouseUpAction = { type: "pointerUp", - button: js-uint, + button: js-uint + } + + input.MouseMoveAction = { + type: "pointerMove", + input.PointerMoveProperties } - input.PointerDownAction = { + input.TouchDownAction = { type: "pointerDown", + input.TouchProperties + } + + input.TouchUpAction = { + type: "pointerUp", + input.TouchProperties + } + + input.TouchMoveAction = { + type: "pointerMove", + input.PointerMoveProperties, + input.TouchProperties + } + + input.TouchProperties = ( + ? width: js-uint .default 1, + ? height: js-uint .default 1, + ? pressure: float .default 0.5 + ) + + input.PenDownAction = { + type: "pointerDown", + button: js-uint, + input.PenProperties + } + + input.PenUpAction = { + type: "pointerUp", button: js-uint, - input.PointerCommonProperties + input.PenProperties } - input.PointerMoveAction = { + input.PenMoveAction = { type: "pointerMove", + input.PointerMoveProperties, + input.PenProperties + } + + input.PenProperties = ( + ? tangentialPressure: float .default 0.0, + ? twist: (0..359) .default 0, + ; 0 .. Math.PI / 2 + ? altitudeAngle: (0.0..1.5707963267948966) .default 1.5707963267948966, + ; 0 .. 2 * Math.PI + ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, + input.TouchProperties, + ) + + input.PointerMoveProperties = ( x: js-int, y: js-int, ? duration: js-uint, - ? origin: input.Origin, - input.PointerCommonProperties - } + ? origin: input.Origin .default "viewport", + ) input.WheelScrollAction = { type: "scroll", - x: js-int, - y: js-int, deltaX: js-int, deltaY: js-int, + x: js-int, + y: js-int, ? duration: js-uint, ? origin: input.Origin .default "viewport", } - input.PointerCommonProperties = ( - ? width: js-uint .default 1, - ? height: js-uint .default 1, - ? pressure: float .default 0.0, - ? tangentialPressure: float .default 0.0, - ? twist: (0..359) .default 0, - ; 0 .. Math.PI / 2 - ? altitudeAngle: (0.0..1.5707963267948966) .default 0.0, - ; 0 .. 2 * Math.PI - ? azimuthAngle: (0.0..6.283185307179586) .default 0.0, - ) - input.Origin = "viewport" / "pointer" / input.ElementOrigin