Skip to content

Commit

Permalink
Update CDDL to updated pointer spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf-2 committed Mar 4, 2024
1 parent bf2dac3 commit 5f26fd4
Showing 1 changed file with 112 additions and 35 deletions.
147 changes: 112 additions & 35 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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.MouseSourceAction = (
input.PauseAction /
input.MouseDownAction /
input.MouseUpAction /
input.MouseMoveAction
)

input.TouchSourceActions = {
type: "pointer",
id: text,
parameters: input.TouchSourceParameters,
actions: [*input.TouchSourceAction]
}

input.TouchSourceParameters = {
pointerType: "touch"
}

input.PointerType = "mouse" / "pen" / "touch"
input.TouchSourceAction = (
input.PauseAction /
input.TouchDownAction /
input.TouchUpAction /
input.TouchMoveAction
)

input.PenSourceActions = {
type: "pointer",
id: text,
parameters: input.PenSourceParameters,
actions: [*input.PenSourceAction]
}

input.PointerParameters = {
? pointerType: input.PointerType .default "mouse"
input.PenSourceParameters = {
pointerType: "pen"
}

input.PointerSourceAction = (
input.PenSourceAction = (
input.PauseAction /
input.PointerDownAction /
input.PointerUpAction /
input.PointerMoveAction
input.PenDownAction /
input.PenUpAction /
input.PenMoveAction
)

input.WheelSourceActions = {
Expand Down Expand Up @@ -10316,46 +10356,83 @@ 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.PointerDownAction = {
input.MouseMoveAction = {
type: "pointerMove",
input.PointerMoveProperties
}

input.TouchDownAction = {
type: "pointerDown",
button: js-uint,
input.PointerCommonProperties
input.TouchProperties
}

input.PointerMoveAction = {
type: "pointerMove",
x: js-int,
y: js-int,
? duration: js-uint,
? origin: input.Origin,
input.PointerCommonProperties
input.TouchUpAction = {
type: "pointerUp",
input.TouchProperties
}

input.WheelScrollAction = {
type: "scroll",
x: js-int,
y: js-int,
deltaX: js-int,
deltaY: js-int,
? duration: js-uint,
? origin: input.Origin .default "viewport",
input.TouchMoveAction = {
type: "pointerMove",
input.PointerMoveProperties,
input.TouchProperties
}

input.PointerCommonProperties = (
input.TouchProperties = (
? width: js-uint .default 1,
? height: js-uint .default 1,
? pressure: float .default 0.0,
? pressure: float .default 0.5
)

input.PenDownAction = {
type: "pointerDown",
button: js-uint,
input.PenProperties
}

input.PenUpAction = {
type: "pointerUp",
button: js-uint,
input.PenProperties
}

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 0.0,
? altitudeAngle: (0.0..1.5707963267948966) .default 1.5707963267948966,
; 0 .. 2 * Math.PI
? azimuthAngle: (0.0..6.283185307179586) .default 0.0,
input.TouchProperties,
)

input.WheelScrollAction = {
type: "scroll",
deltaX: js-int,
deltaY: js-int,
input.PointerMoveProperties,
}

input.PointerMoveProperties = (
x: js-int,
y: js-int,
? duration: js-uint,
? origin: input.Origin .default "viewport",
)

input.Origin = "viewport" / "pointer" / input.ElementOrigin
Expand Down

0 comments on commit 5f26fd4

Please sign in to comment.