Skip to content
kerrishotts edited this page Apr 2, 2013 · 1 revision

(part of UI)

Returns: event container

Parameters: a mouse or touch event

Returns an event container of the form:

{
    touches:[],
    x: x, y: y,
    avgX: avgX,
    avgY: avgY
}

Normalizes, to some extent, the event handling mechanism that is different between Windows Phone and Webkit-based mobile browsers, as well as desktop browsers. Mouse events are translated to touch events via PKUI.CORE.addTouchListener.

Touches are stored in the touches array. Each item is of the form { x: x, y: y }. The first touch is also specified outside the array in x and y.

The average of all touches is stored in avgX and avgY.

If no touch has been registered, the touches array will be empty, and the other properties will be -1.

Usage

var event = UI.makeEvent ( e || window.event )

Version

0.3 Introduced; Docs Valid

Clone this wiki locally