Touch Event Constants
In addition to the key events described in the previous section, radios with a color touch screen also provide touch events to the widget scripts.
The following touch events are passed in the event
argument to the widget script refresh
function (when in full screen mode), just like the key events. The following touch events are provided:
In addition to the above touch events a touchState
table is passed to refresh
with the following addional data fields:
Notes:
touchState
isnil
ifevent
is not a touch event. This can be used to test if we have a touch event or a key event.Since Lua evaluates a
nil
value tofalse
and everything else totrue
:if touchState then
we have a touch event.
x, y
are present for all touch events.startX, startY, slideX, slideY
are only present withEVT_TOUCH_SLIDE
.swipeUp
/swipeDown
/swipeLeft
/swipeRight
may be present only withEVT_TOUCH_SLIDE
.tapCount
is zero for anything butEVT_TOUCH_TAP
.
Last updated