layout | tags |
---|---|
doc-api.html |
internal, global-service |
Observes user interaction method to distinguish pointer and keyboard actions.
Observes keyboard-, pointer-, mouse- and touch-events so that a query for the current interaction type can be made at any time. For pointer interaction this observer is limited to pointer button down/up - move is not observed!
var handle = ally.observe.interactionType();
// stop observing
handle.disengage();
// query current interaction type
var type = handle.get();
A <global-service>
interface, providing the handle.disengage()
method to stop the service.
The handle
is returned when engaging the service. As the <global-service>
interface describes, the handle.disengage()
method is provided to stop the service. Additionally the following methods are made available:
The handle.get()
method does not accept any arguments and returns an object with the following properties:
Name | Type | Description |
---|---|---|
key | boolean | true if any key is currently pressed. |
pointer | boolean | true if any mouse button (or pointer, or touch) is currently pressed. |