Skip to content

Add PointerEvent and related event handlers. #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 13, 2018
Merged
2 changes: 2 additions & 0 deletions src/main/scala/org/scalajs/dom/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ package object dom {
type MessagePort = raw.MessagePort
type ModifierKeyEvent = raw.ModifierKeyEvent
type MouseEvent = raw.MouseEvent
type PointerEvent = raw.PointerEvent
type PointerEventInit = raw.PointerEventInit
@deprecated("Obsolete.", "WHATWG DOM")
type MutationEvent = raw.MutationEvent
@deprecated("Obsolete.", "WHATWG DOM")
Expand Down
156 changes: 156 additions & 0 deletions src/main/scala/org/scalajs/dom/raw/Html.scala
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,84 @@ abstract class HTMLDocument extends Document {
var oncanplaythrough: js.Function1[Event, _] = js.native

var onstoragecommit: js.Function1[StorageEvent, _] = js.native

/**
* fired when a pointing device is moved into an element's hit test boundaries.
*
* MDN
*/
var onpointerover: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointing device is moved into the hit test boundaries of an element
* or one of its descendants, including as a result of a pointerdown event
* from a device that does not support hover (see pointerdown).
*
* MDN
*/
var onpointerenter: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer becomes active.
*
* MDN
*/
var onpointerdown: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer changes coordinates.
*
* MDN
*/
var onpointermove: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer is no longer active.
*
* MDN
*/
var onpointerup: js.Function1[PointerEvent, _] = js.native

/**
* a browser fires this event if it concludes the pointer will no longer be able
* to generate events (for example the related device is deactived).
*
* MDN
*/
var onpointercancel: js.Function1[PointerEvent, _] = js.native

/**
* fired for several reasons including: pointing device is moved out of
* the hit test boundaries of an element;
* firing the pointerup event for a device that does not support hover (see pointerup);
* after firing the pointercancel event (see pointercancel);
* when a pen stylus leaves the hover range detectable by the digitizer.
*
* MDN
*/
var onpointerout: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointing device is moved out of the hit test boundaries of an element.
* For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
*
* MDN
*/
var onpointerleave: js.Function1[PointerEvent, _] = js.native

/**
* fired when an element receives pointer capture.
*
* MDN
*/
var gotpointercapture: js.Function1[PointerEvent, _] = js.native

/**
* Fired after pointer capture is released for a pointer.
*
* MDN
*/
var lostpointercapture: js.Function1[PointerEvent, _] = js.native
}

/**
Expand Down Expand Up @@ -4117,6 +4195,84 @@ abstract class HTMLElement extends Element {
* is an HTMLElement) that we are getting an HTMLDocument here.
*/
override def ownerDocument: HTMLDocument = js.native

/**
* fired when a pointing device is moved into an element's hit test boundaries.
*
* MDN
*/
var onpointerover: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointing device is moved into the hit test boundaries of an element
* or one of its descendants, including as a result of a pointerdown event
* from a device that does not support hover (see pointerdown).
*
* MDN
*/
var onpointerenter: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer becomes active.
*
* MDN
*/
var onpointerdown: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer changes coordinates.
*
* MDN
*/
var onpointermove: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointer is no longer active.
*
* MDN
*/
var onpointerup: js.Function1[PointerEvent, _] = js.native

/**
* a browser fires this event if it concludes the pointer will no longer be able
* to generate events (for example the related device is deactived).
*
* MDN
*/
var onpointercancel: js.Function1[PointerEvent, _] = js.native

/**
* fired for several reasons including: pointing device is moved out of
* the hit test boundaries of an element;
* firing the pointerup event for a device that does not support hover (see pointerup);
* after firing the pointercancel event (see pointercancel);
* when a pen stylus leaves the hover range detectable by the digitizer.
*
* MDN
*/
var onpointerout: js.Function1[PointerEvent, _] = js.native

/**
* fired when a pointing device is moved out of the hit test boundaries of an element.
* For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
*
* MDN
*/
var onpointerleave: js.Function1[PointerEvent, _] = js.native

/**
* fired when an element receives pointer capture.
*
* MDN
*/
var gotpointercapture: js.Function1[PointerEvent, _] = js.native

/**
* Fired after pointer capture is released for a pointer.
*
* MDN
*/
var lostpointercapture: js.Function1[PointerEvent, _] = js.native
}

/**
Expand Down
Loading