diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-19 11:50:43 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-28 08:56:50 +1000 |
commit | 6b3a032fdf5479cb5be441a01ebef92a39e5fb69 (patch) | |
tree | 68a77a9149dd9990c4737d68ac025131b48b3a6e | |
parent | 44c1de333acf1de22f570a16421e0ff4889b0809 (diff) |
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>
-rw-r--r-- | include/synaptics-properties.h | 4 | ||||
-rw-r--r-- | man/synaptics.man | 9 | ||||
-rw-r--r-- | src/properties.c | 12 |
3 files changed, 25 insertions, 0 deletions
diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h index f1591a4..b944adb 100644 --- a/include/synaptics-properties.h +++ b/include/synaptics-properties.h @@ -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_ */ diff --git a/man/synaptics.man b/man/synaptics.man index 372ce2d..4f8b2d4 100644 --- a/man/synaptics.man +++ b/man/synaptics.man @@ -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 diff --git a/src/properties.c b/src/properties.c index 886b4c1..70b59e0 100644 --- a/src/properties.c +++ b/src/properties.c @@ -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; |