Add "Synaptics Capabilities" read-only property.

This patch adds a "Synaptics Capabilities" property that advertises the
capabilities of the device in a read-only boolean property.
The first three values signal the presence of physical mouse buttons (left,
middle, right). Values 4 and 5 signal the touchpad's ability to do
multi-finger tracking.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
This commit is contained in:
Peter Hutterer
2009-05-19 11:50:43 +10:00
parent 44c1de333a
commit 6b3a032fdf
3 changed files with 25 additions and 0 deletions

View File

@@ -145,4 +145,8 @@
/* 8 bit (BOOL), 1 value, tap-and-drag */
#define SYNAPTICS_PROP_GESTURES "Synaptics Gestures"
/* 8 bit (BOOL), 5 values (read-only), has_left, has_middle, has_right,
* has_double, has_triple */
#define SYNAPTICS_PROP_CAPABILITIES "Synaptics Capabilities"
#endif /* _SYNAPTICS_PROPERTIES_H_ */

View File

@@ -809,6 +809,15 @@ FLOAT, 2 values, min, max.
.BI "Synaptics Gestures"
8 bit (BOOL), 1 value, tap-and-drag.
.TP 7
.BI "Synaptics Capabilities"
This read-only property expresses the physical capability of the touchpad,
most notably whether the touchpad hardware supports multi-finger tapping and
scrolling.
8 bit (BOOL), 5 values (read-only), has left button, has middle button, has
right button, two-finger detection, three-finger detection.
.SH "NOTES"
There is an example hal policy file in
.I ${sourcecode}/fdi/11-x11-synaptics.fdi

View File

@@ -81,6 +81,7 @@ Atom prop_pressuremotion = 0;
Atom prop_pressuremotion_factor = 0;
Atom prop_grab = 0;
Atom prop_gestures = 0;
Atom prop_capabilities = 0;
static Atom
InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
@@ -254,6 +255,13 @@ InitDeviceProperties(LocalDevicePtr local)
values[0] = para->tap_and_drag_gesture;
prop_gestures = InitAtom(local->dev, SYNAPTICS_PROP_GESTURES, 8, 1, values);
values[0] = priv->has_left;
values[1] = priv->has_middle;
values[2] = priv->has_right;
values[3] = priv->has_double;
values[4] = priv->has_triple;
prop_capabilities = InitAtom(local->dev, SYNAPTICS_PROP_CAPABILITIES, 8, 5, values);
}
int
@@ -600,6 +608,10 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
return BadMatch;
para->grab_event_device = *(BOOL*)prop->data;
} else if (property == prop_capabilities)
{
/* read-only */
return BadValue;
}
return Success;