diff options
author | Jason Gerecke <jason.gerecke@wacom.com> | 2019-06-19 09:25:30 -0700 |
---|---|---|
committer | Jason Gerecke <jason.gerecke@wacom.com> | 2019-08-12 14:49:03 -0700 |
commit | a13f2bfe177b9eb0f747d1eb9044840f48d762cd (patch) | |
tree | 1e03b114d9249bd9e809e016aab0632bd5c54d89 | |
parent | 2cf46016810056d3fd08c6b7dec3b33089f64672 (diff) | |
download | xf86-input-wacom-a13f2bfe177b9eb0f747d1eb9044840f48d762cd.tar.gz |
Allow use of proxout feature for any relative tablet tool (stylus, eraser, cursor)
The proxout feature makes it easier to use tools in relative mode by not
requiring the user to completely remove the tool from hardware prox before
repositioning. Traditionally only the cursor tool is used in relative
mode, but there are also times that stylus/eraser might also be. This
patch allows any relative tablet tool to make use of the feature.
Ref: https://github.com/linuxwacom/input-wacom/issues/54
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | man/wacom.man | 6 | ||||
-rw-r--r-- | man/xsetwacom.man | 6 | ||||
-rw-r--r-- | src/wcmCommon.c | 8 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 9 | ||||
-rw-r--r-- | src/wcmXCommand.c | 4 |
5 files changed, 18 insertions, 15 deletions
diff --git a/man/wacom.man b/man/wacom.man index e8b9513..6479fff 100644 --- a/man/wacom.man +++ b/man/wacom.man @@ -214,9 +214,9 @@ X server is running, no other programs will be able to read the event stream. Default: "false". .TP 4 .B Option \fI"CursorProx"\fP \fI"number"\fP -sets the max distance from tablet to stop reporting movement for the cursor. -Default for Intuos series is 10, for Graphire series (including Volitos) is -42. Only available for the cursor/puck device. +sets the distance at which a relative tool is treated as being out of proximity. +Beyond this distance the cursor will stop responding to tool motion. The +default value is 10 for Intuos Pro devices and 42 for Intuos/Bamboo devices. .TP 4 .B Option \fI"RawSample"\fP \fI"number"\fP Set the sample window size (a sliding average sampling window) for diff --git a/man/xsetwacom.man b/man/xsetwacom.man index d919e5c..6e295e3 100644 --- a/man/xsetwacom.man +++ b/man/xsetwacom.man @@ -255,9 +255,9 @@ This is a read-only parameter. Initial touch switch state is retrieved from the kernel when X driver starts. .TP \fBCursorProximity\fR distance -sets the max distance from tablet to stop reporting movement for cursor in -relative mode. Default for Intuos series is 10, for Graphire series (including -Volitos) is 42. Only available for the cursor/puck device. +Set the distance at which a relative tool is treated as being out of proximity. +Beyond this distance the cursor will stop responding to tool motion. The +default value is 10 for Intuos Pro devices and 42 for Intuos/Bamboo devices. .TP \fBThreshold\fR level Set the minimum pressure necessary to generate a Button event for the stylus diff --git a/src/wcmCommon.c b/src/wcmCommon.c index d247f14..bf04abe 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1366,15 +1366,17 @@ static void commonDispatchDevice(InputInfoPtr pInfo, } /* force out-prox when distance from surface exceeds wcmProxoutDist */ - if (IsCursor(priv)) + if (IsTablet(priv) && !is_absolute(pInfo)) { /* Assume the the user clicks the puck buttons while - * it is resting on the tablet. This works for both + * it is resting on the tablet (and taps styli onto + * the tablet surface). This works for both * tablets that have a normal distance scale (protocol * 5) as well as those with an inverted scale (protocol * 4 for many many kernel versions). */ - if (filtered.buttons) + if ((IsCursor(priv) && filtered.buttons) || + (IsStylus(priv) && filtered.buttons & 0x01)) priv->wcmSurfaceDist = filtered.distance; DBG(10, priv, "Distance over" diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index 0f34493..8fa3c76 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -922,13 +922,14 @@ Bool wcmPreInitParseOptions(InputInfoPtr pInfo, Bool is_primary, if (wcmParseSerials (pInfo) != 0) goto error; - if (IsCursor(priv)) + if (IsTablet(priv)) { - priv->wcmProxoutDist = xf86SetIntOption(pInfo->options, "CursorProx", 0); + const char *prop = IsCursor(priv) ? "CursorProx" : "StylusProx"; + priv->wcmProxoutDist = xf86SetIntOption(pInfo->options, prop, 0); if (priv->wcmProxoutDist < 0 || priv->wcmProxoutDist > common->wcmMaxDist) - xf86Msg(X_CONFIG, "%s: CursorProx invalid %d \n", - pInfo->name, priv->wcmProxoutDist); + xf86Msg(X_CONFIG, "%s: %s invalid %d \n", + pInfo->name, prop, priv->wcmProxoutDist); } priv->topX = xf86SetIntOption(pInfo->options, "TopX", 0); diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c index 9828d8b..154be1d 100644 --- a/src/wcmXCommand.c +++ b/src/wcmXCommand.c @@ -273,7 +273,7 @@ void InitWcmDeviceProperties(InputInfoPtr pInfo) values[0] = priv->serial; prop_serial_binding = InitWcmAtom(pInfo->dev, WACOM_PROP_SERIAL_BIND, XA_INTEGER, 32, 1, values); - if (IsCursor(priv)) { + if (IsTablet(priv)) { values[0] = priv->wcmProxoutDist; prop_proxout = InitWcmAtom(pInfo->dev, WACOM_PROP_PROXIMITY_THRESHOLD, XA_INTEGER, 32, 1, values); } @@ -842,7 +842,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (prop->size != 1 || prop->format != 32) return BadValue; - if (!IsCursor (priv)) + if (!IsTablet (priv)) return BadValue; value = *(CARD32*)prop->data; |