Module device.input

An interface to get input events.

Functions

Input.open (device, is_emu_events) wrapper for FFI input open

Note that we adhere to the "." syntax here for compatibility.

Input:registerEventAdjustHook (hook, hook_params) Different device models can implement their own hooks and register them.
Input:adjustTouchSwitchXY (ev) Catalog of predefined hooks.
Input:handleTouchEv (ev) Parse each touch ev from kernel and build up tev.
Input:waitEvent (timeout_us) Main event handling.


Functions

Input.open (device, is_emu_events)
wrapper for FFI input open

Note that we adhere to the "." syntax here for compatibility. TODO: clean up separation FFI/this

Parameters:

  • device
  • is_emu_events
Input:registerEventAdjustHook (hook, hook_params)
Different device models can implement their own hooks and register them.

Parameters:

  • hook
  • hook_params
Input:adjustTouchSwitchXY (ev)
Catalog of predefined hooks.

Parameters:

  • ev
Input:handleTouchEv (ev)
Parse each touch ev from kernel and build up tev. tev will be sent to GestureDetector:feedEvent

Events for a single tap motion from Linux kernel (MT protocol B):

MT_TRACK_ID: 0
MT_X: 222
MT_Y: 207
SYN REPORT
MT_TRACK_ID: -1
SYN REPORT

Notice that each line is a single event.

From kernel document: For type B devices, the kernel driver should associate a slot with each identified contact, and use that slot to propagate changes for the contact. Creation, replacement and destruction of contacts is achieved by modifying the ABSMTTRACKING_ID of the associated slot. A non-negative tracking id is interpreted as a contact, and the value -1 denotes an unused slot. A tracking id not previously present is considered new, and a tracking id no longer present is considered removed. Since only changes are propagated, the full state of each initiated contact has to reside in the receiving end. Upon receiving an MT event, one simply updates the appropriate attribute of the current slot.

Parameters:

  • ev
Input:waitEvent (timeout_us)
Main event handling.

Parameters:

  • timeout_us
generated by LDoc 1.4.6 Last updated 2017-10-08 14:57:40