+----------------------
ALPS Touchpad Protocol
----------------------
Packet Format
-------------
-In the following tables, the following notation is used.
+In the following tables, the following notation is used::
CAPITALS = stick, miniscules = touchpad
PS/2 packet format
------------------
+::
+
byte 0: 0 0 YSGN XSGN 1 M R L
byte 1: X7 X6 X5 X4 X3 X2 X1 X0
byte 2: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
pointingstick and touchpad buttons.
ALPS Absolute Mode - Protocol Version 1
---------------------------------------
+---------------------------------------
+
+::
byte 0: 1 0 0 0 1 x9 x8 x7
byte 1: 0 x6 x5 x4 x3 x2 x1 x0
ALPS Absolute Mode - Protocol Version 2
---------------------------------------
+::
+
byte 0: 1 ? ? ? 1 PSM PSR PSL
byte 1: 0 x6 x5 x4 x3 x2 x1 x0
byte 2: 0 x10 x9 x8 x7 ? fin ges
Dualpoint device -- interleaved packet format
---------------------------------------------
+::
+
byte 0: 1 1 0 0 1 1 1 1
byte 1: 0 x6 x5 x4 x3 x2 x1 x0
byte 2: 0 x10 x9 x8 x7 0 fin ges
associated with touchpad events, and the third is associated with trackstick
events.
-The first type is the touchpad position packet.
+The first type is the touchpad position packet::
byte 0: 1 ? x1 x0 1 1 1 1
byte 1: 0 x10 x9 x8 x7 x6 x5 x4
bitmaps a given bit is set if there is a finger covering that position on the
given axis. Thus the bitmap packet can be used for low-resolution multi-touch
data, although finger tracking is not possible. This packet also encodes the
-number of contacts (f1 and f0 in the table below).
+number of contacts (f1 and f0 in the table below)::
byte 0: 1 1 x1 x0 1 1 1 1
byte 1: 0 x8 x7 x6 x5 x4 x3 x2
usually only appears when there are two or more contacts (although
occasionally it's seen with only a single contact).
-The final v3 packet type is the trackstick packet.
+The final v3 packet type is the trackstick packet::
byte 0: 1 1 x7 y7 1 1 1 1
byte 1: 0 x6 x5 x4 x3 x2 x1 x0
ALPS Absolute Mode - Protocol Version 4
---------------------------------------
-Protocol version 4 has an 8-byte packet format.
+Protocol version 4 has an 8-byte packet format::
byte 0: 1 ? x1 x0 1 1 1 1
byte 1: 0 x10 x9 x8 x7 x6 x5 x4
The last two bytes represent a partial bitmap packet, with 3 full packets
required to construct a complete bitmap packet. Once assembled, the 6-byte
-bitmap packet has the following format:
+bitmap packet has the following format::
byte 0: 0 1 x7 x6 x5 x4 x3 x2
byte 1: 0 x1 x0 y4 y3 y2 y1 y0
specialized decode_fields function pointer to correctly interpret the
packets. This appears to only be used by the Dolphin devices.
-For single-touch, the 6-byte packet format is:
+For single-touch, the 6-byte packet format is::
byte 0: 1 1 0 0 1 0 0 0
byte 1: 0 x6 x5 x4 x3 x2 x1 x0
byte 4: y10 y9 y8 y7 x10 x9 x8 x7
byte 5: 0 z6 z5 z4 z3 z2 z1 z0
-For mt, the format is:
+For mt, the format is::
byte 0: 1 1 1 n3 1 n2 n1 x24
byte 1: 1 y7 y6 y5 y4 y3 y2 y1
ALPS Absolute Mode - Protocol Version 6
---------------------------------------
-For trackstick packet, the format is:
+For trackstick packet, the format is::
byte 0: 1 1 1 1 1 1 1 1
byte 1: 0 X6 X5 X4 X3 X2 X1 X0
byte 4: Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
byte 5: 0 1 1 1 1 1 1 1
-For touchpad packet, the format is:
+For touchpad packet, the format is::
byte 0: 1 1 1 1 1 1 1 1
byte 1: 0 0 0 0 x3 x2 x1 x0
ALPS Absolute Mode - Protocol Version 7
---------------------------------------
-For trackstick packet, the format is:
+For trackstick packet, the format is::
byte 0: 0 1 0 0 1 0 0 0
byte 1: 1 1 * * 1 M R L
byte 4: Y7 0 Y5 Y4 Y3 1 1 0
byte 5: T&P 0 Z5 Z4 Z3 Z2 Z1 Z0
-For touchpad packet, the format is:
+For touchpad packet, the format is::
packet-fmt b7 b6 b5 b4 b3 b2 b1 b0
byte 0: TWO & MULTI L 1 R M 1 Y0-2 Y0-1 Y0-0
The packet type is given by the APD field, bits 4-5 of byte 3.
-Touchpad packet (APD = 0x2):
+Touchpad packet (APD = 0x2)::
b7 b6 b5 b4 b3 b2 b1 b0
byte 0: SWM SWR SWL 1 1 0 0 X7
SWM, SWR, SWL: Middle, Right, and Left button states
-Touchpad 1 Finger packet (APD = 0x0):
+Touchpad 1 Finger packet (APD = 0x0)::
b7 b6 b5 b4 b3 b2 b1 b0
byte 0: SWM SWR SWL 1 1 X2 X1 X0
TAPF: ???
LFB: ???
-Touchpad 2 Finger packet (APD = 0x1):
+Touchpad 2 Finger packet (APD = 0x1)::
b7 b6 b5 b4 b3 b2 b1 b0
byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4
CONT: A 3-or-4 Finger packet is to follow
-Touchpad 3-or-4 Finger packet (APD = 0x3):
+Touchpad 3-or-4 Finger packet (APD = 0x3)::
b7 b6 b5 b4 b3 b2 b1 b0
byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4