[Linuxwacom-devel] [PATCH v2 4/5] Don't rotate hotplugged devices.

2011-04-04 Thread Peter Hutterer

We only rotate on a per-tablet basis, not per-tool. Don't accept rotation
values on dependent devices (unless they're the same, then be quiet about
it).

Signed-off-by: Peter Hutterer 
---
Changes to v1:
- use "parent device" in the man page (see the man page additions on the
  list)
- fix rotation setting for xorg.conf devices, mark devices 

side effect is that xorg.conf devices that specify different rotation for
different devices will not work as requested but at least that's a
long-standing bug anyway.

we really need flags for hotplugged, parent and xorg.conf devices. but at
this stage in the cycle, that's more change than I'd like to introduce.

 man/wacom.man   |4 +++-
 src/wcmConfig.c |   23 ---
 src/wcmValidateDevice.c |   16 
 src/xf86Wacom.h |2 +-
 4 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 1594836..797b388 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -138,7 +138,9 @@ can be an integer from -1 to 5.  Default is 3 for 
capacitive tools and
 .B Option \fI"Rotate"\fP \fI"CW"|"CCW"|"HALF"|"NONE"\fP
 rotates the tablet orientation counterclockwise (CCW) or clockwise (CW) or 180 
degrees (HALF). 
 If you have specific tablet mappings, i.e. TopX/Y or BottomX/Y were set, the 
mapping will be 
-applied before rotation. The default is "NONE".
+applied before rotation. Rotation must be applied to the parent device
+(usually the stylus), rotation settings on hotplugged devices will be
+ignored. The default is "NONE".
 .TP 4
 .B Option \fI"PressCurve"\fP \fI"x1,y1,x2,y2"\fP
 sets pressure curve by control points x1, y1, x2, and y2.  Their values are in 
range 
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 4caa529..3ccd902 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -448,6 +448,21 @@ static void wcmLinkTouchAndPen(InputInfoPtr pInfo)
}
 }
 
+/**
+ * Check if this device was hotplugged by the driver by checking the _source
+ * option.
+ *
+ * Must be called before wcmNeedAutoHotplug()
+ *
+ * @return True if the source for this device is the wacom driver itself or
+ * false otherwise.
+ */
+static int wcmIsHotpluggedDevice(InputInfoPtr pInfo)
+{
+   char *source = xf86CheckStrOption(pInfo->options, "_source", "");
+   return !strcmp(source, "_driver/wacom");
+}
+
 /* wcmPreInit - called for each input devices with the driver set to
  * "wacom" */
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
@@ -487,7 +502,7 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
WacomCommonPtr common = NULL;
const char* type;
char*   device, *oldname;
-   int need_hotplug = 0;
+   int need_hotplug = 0, is_dependent = 0;
 
gWacomModule.wcmDrv = drv;
 
@@ -534,7 +549,9 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
 
oldname = pInfo->name;
 
-   if ((need_hotplug = wcmNeedAutoHotplug(pInfo, &type)))
+   if (wcmIsHotpluggedDevice(pInfo))
+   is_dependent = 1;
+   else if ((need_hotplug = wcmNeedAutoHotplug(pInfo, &type)))
{
/* we need subdevices, change the name so all of them have a
   type. */
@@ -551,7 +568,7 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
if (!wcmSetType(pInfo, type))
goto SetupProc_fail;
 
-   if (!wcmParseOptions(pInfo, need_hotplug))
+   if (!wcmParseOptions(pInfo, need_hotplug, is_dependent))
goto SetupProc_fail;
 
if (!wcmInitModel(pInfo))
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 0b03952..610da22 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -513,6 +513,7 @@ int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char 
**type)
xf86Msg(X_INFO, "%s: type not specified, assuming '%s'.\n", 
pInfo->name, *type);
xf86Msg(X_INFO, "%s: other types will be automatically added.\n", 
pInfo->name);
 
+   /* Note: wcmIsHotpluggedDevice() relies on this */
pInfo->options = xf86AddNewOption(pInfo->options, "Type", *type);
pInfo->options = xf86ReplaceStrOption(pInfo->options, "_source", 
"_driver/wacom");
 
@@ -521,12 +522,16 @@ int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char 
**type)
 
 /**
  * Parse the options for this device.
+ * Note that parameters is_primary and is_dependent are mutually exclusive,
+ * though both may be false in the case of an xorg.conf device.
  *
- * @param is_primary True if the device is the primary/parent device for
+ * @param is_primary True if the device is the parent device for
  * hotplugging, False if the device is a depent or xorg.conf device.
+ * @param is_hotplugged True if the device is a dependent device, FALSE
+ * otherwise.
  * @retvalue True on success or False otherwise.
  */
-Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary)
+Bool wcmParseOpti

[Linuxwacom-devel] [PATCH 4/4] man: add hotplugging info to man page

2011-04-04 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 man/wacom.man |   34 +++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 31db124..97815b4 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -20,9 +20,37 @@ The
 driver functions as a pointer input device.
 .SH SUPPORTED HARDWARE
 This driver supports the Wacom IV and Wacom V protocols. Serial tablets only 
-need this driver.  USB tablet support is available on some Linux platforms. 
-USB tablets needs wacom kernel driver being loaded before this driver starts.  
-Please check linuxwacom.sf.net for latest updates of Wacom X and kernel 
drivers.
+need this driver.  USB tablet support is available on some Linux platforms
+and requires the wacom kernel driver being loaded before this driver starts.
+Please check http://linuxwacom.sf.net for latest updates of Wacom X and
+kernel drivers.
+.SH DRIVER-INTERNAL DEVICE HOTPLUGGING
+When input device hotplugging in the X server is enabled and no
+.B InputDevice
+section exists for a compatible tablet device and an
+.B InputClass
+section (see xorg.conf.d(5x)) assigns this driver for the device, the
+.B wacom
+driver creates multiple X devices for each a physical device, one X device
+for each available tool. The list of tools is hardware-dependent. See
+.B Option "Type"
+as outlined in the
+.B CONFIGURATION DETAILS
+section.
+.PP
+These tool-specific devices are referred to as parent device and dependent
+device.  The parent device is the one presented by the system and the one
+that causes the X server to load the
+.B wacom
+driver. This parent device then causes the automatic addition of several
+dependent devices. If the parent device is unplugged or otherwise removed,
+the dependent devices will be automatically removed as well.
+.PP
+Dependent devices may be assigned tool-specific options through additional
+.B InputClass
+sections. We recommend that a
+.B MatchDriver "wacom"
+line is used in these sections in addition to the user-specific pattern.
 .SH CONFIGURATION DETAILS
 Please refer to xorg.conf(5x) or xorg.conf.d(5x) for general configuration
 details and for options that can be used with all input drivers.  This
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 3/4] man: remove reference about different zones - unsupported

2011-04-04 Thread Peter Hutterer
We ripped this out with 13a12bb852f8 Purge toolarea from device rec.

Signed-off-by: Peter Hutterer 
---
 man/wacom.man |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 61d3ea3..31db124 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -28,8 +28,7 @@ Please refer to xorg.conf(5x) or xorg.conf.d(5x) for general 
configuration
 details and for options that can be used with all input drivers.  This
 section only covers configuration details specific to this driver.
 .PP
-Multiple instances of the Wacom devices can cohabit. It can be useful
-to define multiple devices with different active zones. Each device
+Multiple instances of the Wacom devices can cohabit. Each device
 supports the following entries:
 .RS 8
 .TP 4
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 2/4] man: don't mention the core pointer, it doesn't exist

2011-04-04 Thread Peter Hutterer
Obsolete since server 1.4

Signed-off-by: Peter Hutterer 
---
 man/wacom.man |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 4aeec9c..61d3ea3 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -17,8 +17,7 @@ is an X input driver for Wacom devices.
 .PP
 The
 .B wacom
-driver functions as a pointer input device, and may be used as the
-X server's core pointer.
+driver functions as a pointer input device.
 .SH SUPPORTED HARDWARE
 This driver supports the Wacom IV and Wacom V protocols. Serial tablets only 
 need this driver.  USB tablet support is available on some Linux platforms. 
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/4] man: refer to both xorg.conf and xorg.conf.d

2011-04-04 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 man/wacom.man |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 8368908..4aeec9c 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -25,7 +25,7 @@ need this driver.  USB tablet support is available on some 
Linux platforms.
 USB tablets needs wacom kernel driver being loaded before this driver starts.  
 Please check linuxwacom.sf.net for latest updates of Wacom X and kernel 
drivers.
 .SH CONFIGURATION DETAILS
-Please refer to xorg.conf(5x) for general configuration
+Please refer to xorg.conf(5x) or xorg.conf.d(5x) for general configuration
 details and for options that can be used with all input drivers.  This
 section only covers configuration details specific to this driver.
 .PP
@@ -186,7 +186,7 @@ The threshold applies to the normalised pressure range of 
[0..2048].
 The default is 27.
 .RE
 .SH "SEE ALSO"
-Xorg(1x), xorg.conf(5x), xorgconfig(1x), Xserver(1x), X(7).
+Xorg(1x), xorg.conf(5x), xorg.conf.d(5x), xorgconfig(1x), Xserver(1x), X(7).
 .SH AUTHORS
 Frederic Lepied ,
 Ping Cheng ,
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 4/5] Don't rotate hotplugged devices.

2011-04-04 Thread Ping Cheng
Reviewed-by: Ping Cheng  for the series except this
patch. Please see my comments inline.

Ping
On Mon, Apr 4, 2011 at 8:44 PM, Peter Hutterer wrote:

> We only rotate on a per-tablet basis, not per-tool. Don't accept rotation
> values on dependent devices (unless they're the same, then be quiet about
> it).
>
> Signed-off-by: Peter Hutterer 
> ---
>  man/wacom.man   |4 +++-
>  src/wcmValidateDevice.c |7 +--
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/man/wacom.man b/man/wacom.man
> index 1594836..8368908 100644
> --- a/man/wacom.man
> +++ b/man/wacom.man
> @@ -138,7 +138,9 @@ can be an integer from -1 to 5.  Default is 3 for
> capacitive tools and
>  .B Option \fI"Rotate"\fP \fI"CW"|"CCW"|"HALF"|"NONE"\fP
>  rotates the tablet orientation counterclockwise (CCW) or clockwise (CW) or
> 180 degrees (HALF).
>  If you have specific tablet mappings, i.e. TopX/Y or BottomX/Y were set,
> the mapping will be
> -applied before rotation. The default is "NONE".
> +applied before rotation. Rotation must be applied to the first device
> +(usually the stylus), rotation settings on hotplugged devices will be
>

 The term "first device (usually the stylus)" may be confusing to some
users. For instance: is it the one in the ServerLayout section or the one in
the InputDevice section? Should we menton the difference between touch and
pen for USB tablets here?

Don't get me wrong. I know what you mean. I am representing our users :).


> +ignored. The default is "NONE".
>  .TP 4
>  .B Option \fI"PressCurve"\fP \fI"x1,y1,x2,y2"\fP
>  sets pressure curve by control points x1, y1, x2, and y2.  Their values
> are in range
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 0b03952..b43b741 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -588,8 +588,11 @@ Bool wcmParseOptions(InputInfoPtr pInfo, Bool
> is_primary)
>goto error;
>}
>
> -   common->wcmRotate = rotation;
> -
> +   if (!is_primary && rotation != common->wcmRotate)
>


I suspect users can ever set/change the rotation for xorg.conf defined tools
since their is_primary is always false, no matter it is the first one or
not. So, for those tools, wcmRotate stay at the default (NONE) forever.



> +   xf86Msg(X_INFO, "%s: ignoring rotation of
> dependent"
> +   " device\n", pInfo->name);
> +   else
> +   common->wcmRotate = rotation;
>}
>
>common->wcmRawSample = xf86SetIntOption(pInfo->options, "RawSample",
> --
> 1.7.4.2
>
>
>
> --
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 0/4] Hover Click/TPCButton inversion

2011-04-04 Thread Ping Cheng
Acked-by: Ping Cheng  for the series.

Ping
On Sun, Apr 3, 2011 at 10:51 PM, Peter Hutterer wrote:

>
> the "Hover Click" property and TPCButton option do the same thing, but
> inverted. Hover Click indicates when hover click is enabled, but TCPButton
> means that hover click is disabled. This patchset restores the Hover Click
> behaviour and fixes xsetwacom at the same time.
>
> Cheers,
>  Peter
>
>
>
> --
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH v2 5/5] Update all tools rotation property when rotating one of them.

2011-04-04 Thread Peter Hutterer
All tools on the same tablet share the rotation value, so if one of them is
rotated, all of them must be. Since the property value is stored in the
server, we need to trigger it explicitly.

Test case:
$> xsetwacom set "device name stylus" Rotate half
$> xsetwacom get "device name eraser" Rotate

Should print out the correct rotation value.

Fixes #3070450

Signed-off-by: Peter Hutterer 
---
 src/wcmCommon.c |7 +++
 src/wcmValidateDevice.c |2 +-
 src/wcmXCommand.c   |   28 
 src/xf86Wacom.h |1 +
 4 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index d474959..d2017f2 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -1350,9 +1350,16 @@ void wcmRotateTablet(InputInfoPtr pInfo, int value)
 {
WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
WacomCommonPtr common = priv->common;
+   WacomToolPtr tool;
 
DBG(10, priv, "\n");
common->wcmRotate = value;
+
+   /* Only try updating properties once we're enabled, no point
+* otherwise. */
+   tool = priv->tool;
+   if (tool->enabled)
+   wcmUpdateRotationProperty(priv);
 }
 
 /* Common pointer refcounting utilities.
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index b43b741..12767be 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -592,7 +592,7 @@ Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary)
xf86Msg(X_INFO, "%s: ignoring rotation of dependent"
" device\n", pInfo->name);
else
-   common->wcmRotate = rotation;
+   wcmRotateTablet(pInfo, rotation);
}
 
common->wcmRawSample = xf86SetIntOption(pInfo->options, "RawSample",
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index f7ff4ef..5428a09 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -540,6 +540,33 @@ static int wcmSetStripProperty(DeviceIntPtr dev, Atom 
property,
 }
 
 /**
+ * Update the rotation property for all tools on the same physical tablet as
+ * pInfo.
+ */
+void wcmUpdateRotationProperty(WacomDevicePtr priv)
+{
+   WacomCommonPtr common = priv->common;
+   WacomDevicePtr other;
+   char rotation = common->wcmRotate;
+
+   for (other = common->wcmDevices; other; other = other->next)
+   {
+   InputInfoPtr pInfo;
+   DeviceIntPtr dev;
+
+   if (other == priv)
+   continue;
+
+   pInfo = other->pInfo;
+   dev = pInfo->dev;
+
+   XIChangeDeviceProperty(dev, prop_rotation, XA_INTEGER, 8,
+  PropModeReplace, 1, &rotation,
+  TRUE);
+   }
+}
+
+/**
  * Only allow deletion of a property if it is not being used by any of the
  * button actions.
  */
@@ -644,6 +671,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 
if (!checkonly && common->wcmRotate != value)
wcmRotateTablet(pInfo, value);
+
} else if (property == prop_serials)
{
return BadValue; /* Read-only */
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index 5351be2..39f55dd 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -167,6 +167,7 @@ extern int wcmGetPhyDeviceID(WacomDevicePtr priv);
 extern int wcmSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr 
prop, BOOL checkonly);
 extern int wcmDeleteProperty(DeviceIntPtr dev, Atom property);
 extern void InitWcmDeviceProperties(InputInfoPtr pInfo);
+extern void wcmUpdateRotationProperty(WacomDevicePtr priv);
 
 /* Utility functions */
 extern Bool is_absolute(InputInfoPtr pInfo);
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 4/5] Don't rotate hotplugged devices.

2011-04-04 Thread Peter Hutterer
We only rotate on a per-tablet basis, not per-tool. Don't accept rotation
values on dependent devices (unless they're the same, then be quiet about
it).

Signed-off-by: Peter Hutterer 
---
 man/wacom.man   |4 +++-
 src/wcmValidateDevice.c |7 +--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 1594836..8368908 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -138,7 +138,9 @@ can be an integer from -1 to 5.  Default is 3 for 
capacitive tools and
 .B Option \fI"Rotate"\fP \fI"CW"|"CCW"|"HALF"|"NONE"\fP
 rotates the tablet orientation counterclockwise (CCW) or clockwise (CW) or 180 
degrees (HALF). 
 If you have specific tablet mappings, i.e. TopX/Y or BottomX/Y were set, the 
mapping will be 
-applied before rotation. The default is "NONE".
+applied before rotation. Rotation must be applied to the first device
+(usually the stylus), rotation settings on hotplugged devices will be
+ignored. The default is "NONE".
 .TP 4
 .B Option \fI"PressCurve"\fP \fI"x1,y1,x2,y2"\fP
 sets pressure curve by control points x1, y1, x2, and y2.  Their values are in 
range 
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 0b03952..b43b741 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -588,8 +588,11 @@ Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary)
goto error;
}
 
-   common->wcmRotate = rotation;
-
+   if (!is_primary && rotation != common->wcmRotate)
+   xf86Msg(X_INFO, "%s: ignoring rotation of dependent"
+   " device\n", pInfo->name);
+   else
+   common->wcmRotate = rotation;
}
 
common->wcmRawSample = xf86SetIntOption(pInfo->options, "RawSample",
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 3/5] Factor out rotation parsing and setting.

2011-04-04 Thread Peter Hutterer
No functional changes, prep work only.

Signed-off-by: Peter Hutterer 
---
 src/wcmValidateDevice.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index ddfcd27..0b03952 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -573,18 +573,23 @@ Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary)
 
if (s)
{
+   int rotation;
+
if (xf86NameCmp(s, "CW") == 0)
-   common->wcmRotate=ROTATE_CW;
+   rotation = ROTATE_CW;
else if (xf86NameCmp(s, "CCW") ==0)
-   common->wcmRotate=ROTATE_CCW;
+   rotation = ROTATE_CCW;
else if (xf86NameCmp(s, "HALF") ==0)
-   common->wcmRotate=ROTATE_HALF;
+   rotation = ROTATE_HALF;
else if (xf86NameCmp(s, "NONE") !=0)
{
xf86Msg(X_ERROR, "%s: invalid Rotate option '%s'.\n",
pInfo->name, s);
goto error;
}
+
+   common->wcmRotate = rotation;
+
}
 
common->wcmRawSample = xf86SetIntOption(pInfo->options, "RawSample",
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 1/5] Remove superfluous call to wcmRotateTablet().

2011-04-04 Thread Peter Hutterer
This is a leftover from the times when we reconfigured the axes based on the
rotation. It doesn't do anything these days.

Signed-off-by: Peter Hutterer 
---
 src/xf86Wacom.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 1e442fb..2af2660 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -341,7 +341,6 @@ static int wcmDevInit(DeviceIntPtr pWcm)
 {
InputInfoPtr pInfo = (InputInfoPtr)pWcm->public.devicePrivate;
WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
-   WacomCommonPtr common = priv->common;
unsigned char butmap[WCM_MAX_BUTTONS+1];
int nbaxes, nbbuttons, nbkeys;
int loop;
@@ -449,8 +448,6 @@ static int wcmDevInit(DeviceIntPtr pWcm)
if (!wcmInitAxes(pWcm))
return FALSE;
 
-   wcmRotateTablet(pInfo, common->wcmRotate);
-
InitWcmDeviceProperties(pInfo);
XIRegisterPropertyHandler(pInfo->dev, wcmSetProperty, NULL, 
wcmDeleteProperty);
 
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH 2/5] Rename hotplugged to is_primary in wcmParseOption.

2011-04-04 Thread Peter Hutterer
The parameter is true for the primary device only (i.e. the one that
_triggers_ the hotplug). It is false for any driver-hotplugged device
and false for xorg.conf devices. So "hotplugged" is a rather misleading
name. Rename to is_primary instead.

Document this and while we're at it, change the function to use Bool instead
of int.

Signed-off-by: Peter Hutterer 
---
 src/wcmValidateDevice.c |   21 ++---
 src/xf86Wacom.h |2 +-
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index 0de9f18..ddfcd27 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -519,7 +519,14 @@ int wcmNeedAutoHotplug(InputInfoPtr pInfo, const char 
**type)
return 1;
 }
 
-int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
+/**
+ * Parse the options for this device.
+ *
+ * @param is_primary True if the device is the primary/parent device for
+ * hotplugging, False if the device is a depent or xorg.conf device.
+ * @retvalue True on success or False otherwise.
+ */
+Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary)
 {
WacomDevicePtr  priv = (WacomDevicePtr)pInfo->private;
WacomCommonPtr  common = priv->common;
@@ -676,7 +683,7 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
tpc_button_is_on = xf86SetBoolOption(pInfo->options, "TPCButton",
TabletHasFeature(common, WCM_TPC));
 
-   if (hotplugged || IsStylus(priv))
+   if (is_primary || IsStylus(priv))
common->wcmTPCButton = tpc_button_is_on;
else if (tpc_button_is_on != common->wcmTPCButton)
xf86Msg(X_WARNING, "%s: TPCButton option can only be set "
@@ -695,7 +702,7 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
touch_is_on = xf86SetBoolOption(pInfo->options, "Touch",
common->wcmTouchDefault);
 
-   if (hotplugged || IsTouch(priv))
+   if (is_primary || IsTouch(priv))
common->wcmTouch = touch_is_on;
else if (touch_is_on != common->wcmTouch)
xf86Msg(X_WARNING, "%s: Touch option can only be set "
@@ -704,7 +711,7 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
capacity_is_on = xf86SetBoolOption(pInfo->options, "Capacity",
   common->wcmCapacityDefault);
 
-   if (hotplugged || IsTouch(priv))
+   if (is_primary || IsTouch(priv))
common->wcmCapacity = capacity_is_on;
else if (capacity_is_on != common->wcmCapacity)
xf86Msg(X_WARNING, "%s: Touch Capacity option can only 
be"
@@ -723,7 +730,7 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
gesture_is_on = xf86SetBoolOption(pInfo->options, "Gesture",
common->wcmGestureDefault);
 
-   if (hotplugged || IsTouch(priv))
+   if (is_primary || IsTouch(priv))
common->wcmGesture = gesture_is_on;
else if (gesture_is_on != common->wcmGesture)
xf86Msg(X_WARNING, "%s: Touch gesture option can only "
@@ -760,10 +767,10 @@ int wcmParseOptions(InputInfoPtr pInfo, int hotplugged)
!common->wcmDevCls->ParseOptions(pInfo))
goto error;
 
-   return 1;
+   return TRUE;
 error:
free(tool);
-   return 0;
+   return FALSE;
 }
 
 /* vim: set noexpandtab tabstop=8 shiftwidth=8: */
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index e5149b3..5351be2 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -140,7 +140,7 @@ extern int wcmNeedAutoHotplug(InputInfoPtr pInfo, const 
char **type);
 extern void wcmHotplugOthers(InputInfoPtr pInfo, const char *basename);
 
 /* setup */
-extern int wcmParseOptions(InputInfoPtr pInfo, int hotplugged);
+extern Bool wcmParseOptions(InputInfoPtr pInfo, Bool is_primary);
 extern void wcmInitialCoordinates(InputInfoPtr pInfo, int axes);
 extern void wcmInitialScreens(InputInfoPtr pInfo);
 extern void wcmInitialScreens(InputInfoPtr pInfo);
-- 
1.7.4.2


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 3/3] Centralize pen and touch arbitration

2011-04-04 Thread Peter Hutterer
On Sun, Apr 03, 2011 at 08:38:37PM -0700, Ping Cheng wrote:
> On Sun, Apr 3, 2011 at 7:51 PM, Peter Hutterer 
> wrote:
> 
> > On Sun, Apr 03, 2011 at 07:23:34PM -0700, Ping Cheng wrote:
> > > On Sun, Apr 3, 2011 at 6:35 PM, Peter Hutterer  > >wrote:
> > >
> > > >  >
> > > > > What information can the user use for Uniq to associate the devices,
> > > > which
> > > > > we do not have in the driver? Both devices have the same product ID
> > and
> > > > > name.
> > > >
> > > > I only have one Bamboo, but the test code below gives me the right
> > answer.
> > > > argv[1,2] are the two device nodes (/dev/input/eventX and
> > > > /dev/input/eventY).
> > > >
> > > > static struct udev_device *udev_from_file(struct udev *udev, const char
> > > > *filename)
> > > > {
> > > >struct stat st;
> > > >stat(filename, &st);
> > > >return udev_device_new_from_devnum(udev, 'c', st.st_rdev);
> > > > }
> > > >
> > > > int main(int argc, char** argv)
> > > > {
> > > >int rc = 1;
> > > >struct udev *udev = NULL;
> > > >struct udev_device *dev1, *dev2 = NULL;
> > > >struct udev_device *parent1, *parent2;
> > > >const char *syspath1, *syspath2;
> > > >
> > > >if (argc < 3)
> > > >goto out;
> > > >
> > > >udev = udev_new();
> > > >dev1 = udev_from_file(udev, argv[1]);
> > > >dev2 = udev_from_file(udev, argv[2]);
> > > >
> > > >if (!dev1 || !dev2)
> > > >goto out;
> > > >
> > > >parent1 = udev_device_get_parent_with_subsystem_devtype(dev1, "usb",
> > > > "usb_device");
> > > >parent2 = udev_device_get_parent_with_subsystem_devtype(dev2, "usb",
> > > > "usb_device");
> > > >
> > > >syspath1 = udev_device_get_syspath(parent1);
> > > >syspath2 = udev_device_get_syspath(parent2);
> > > >
> > >
> > >
> > > This looks very promising. So, we do not need anything from the user.
> > > Everything could be done inside the driver. Are you going to make a
> > patch?
> >
> > can't right now, got too many other things on my slate, sorry.
> >
> 
> That's fine. I may be able to get to it after next week.
> 
> Can you test the code with two of your Intuos4's? If we get "Nope, different
> devices" for two identical devices, we are ready to move forward. Otherwise,
> ...
> 
> I will not be in the office next whole week. So, I do not have two identical
> devices to play with.

yeah, as expected, it says that the devices are different.

Cheers,
  Peter

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [linuxwacom-announce] [ANNOUNCE] xf86-input-wacom 0.10.99.1

2011-04-04 Thread Peter Hutterer
On Mon, Apr 04, 2011 at 10:29:15AM -0700, Jason Gerecke wrote:
> On Sun, Apr 3, 2011 at 10:42 PM, Peter Hutterer
>  wrote:
> > On Mon, Apr 04, 2011 at 07:32:44AM +0200, Andrzej Giniewicz wrote:
> >> > are you scrolling through gestures? afaict the scrolling code is 
> >> > hardcoded
> >> > to use 4/5 6/7 instead of the button mapping.
> >>
> >> yes, that was of course using gestures. It worked in 0.10.11 so I
> >> believe it was recent change to hardcode it?
> >
> > what changed was the way how xsetwacom worked. it used to set the X logical
> > button mapping but that's not the case anymore for simple button
> > mappings.
> >
> > Jason can tell you more but in the meantime xinput set-button-map "device
> > name" ... will get you there.
> >
> > Cheers,
> >  Peter
> >
> 
> If gesture code is hardcoded to use 4/5 (or to use e.g. relup/reldn)
> then that would actually explain the bug perfectly. Like Peter said,
> `xinput set-button-map` should work around the issue for now, but I'll
> try to see if I can get my hands on a bamboo and find where/how
> gestures are handled.

wcmTouchFilter.c, wcmSendScrollEvent()

Cheers,
  Peter

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 5/7] Decrease minimum number of args to 'set' [allow wheels/strips "reset"]

2011-04-04 Thread Peter Hutterer
On Mon, Apr 04, 2011 at 10:15:16AM -0700, Jason Gerecke wrote:
> On Sun, Apr 3, 2011 at 8:26 PM, Peter Hutterer  
> wrote:
> > On Fri, Apr 01, 2011 at 11:17:15AM -0700, Jason Gerecke wrote:

[cutting some context. why? because I can!]

> >> The latter is changed by wcmUpdateButtonKeyActions
> >> (after a long call chain beginning with wcmSetProperty) whenever X
> >> detects a change in the WACOM_PROP_STRIPBUTTONS property.
> >> getWheelButton then returns both of these to sendWheelStripEvents. If
> >> a "key" is defined, it will preferentially decode it and send the
> >> necessary events. Otherwise, it interprets the raw integer fakeButton
> >> as the X button to send a button press event for.
> >>
> >> When xsetwacom is given arguments to StripLeftUp, it converts them
> >> into an action and modifies the appropriate offset into
> >> WACOM_PROP_STRIPBUTTONS. When the appropriate motion is made the
> >> driver notices an action is sent and sends it. When it is run without
> >> arguments, it clears the offset, so the same motion results in the
> >> driver not finding an action and sending the default button. Note that
> >> xsetwacom works the same way for "Button X"! Running with arguments
> >> sets an action the driver will preferentially use; running without
> >> arguments clears the action, forcing the driver to fall back on the
> >> raw integer defined in the button[] array.
> >
> > right, so if I understand this correctly, the "default button" it uses then
> > is the (essentially hardcoded) striplup value. which brings me back to my
> > original question: it doesn't reset to the default value but rather removes
> > the new button mapping.  if you could change striplup, removing a button
> > mapping would reset to whatever striplup has as current value (and that may
> > not be the _default_). currently this works, but only because we don't seem
> > to have a way to change it. it's really just the wording that matters to me
> > here, even if it appears to be overly anal :)
> >
> I see now -- yes, you are understanding things correctly.
> 
> However, In regards to this and your prior paragraph, I'm not sure I
> see the logic in letting the user change striplup. Why /should/ the
> user be able to modify it? If they don't like the mapping, why not use
> already-extant features like setting an action (i.e. modify
> strip_keys[0])? I've tried thinking of several possible motivations,
> but am coming up blank :(
> 
> Also, what did you mean by "in spirit with the other discussion of
> allowing physical mappings"? I'm not sure I understand since the
> button[] array is already physical-button-indexed and the strip_keys[]
> and wheel_keys[] don't really /have/ physical buttons... IIRC only
> keys[] is X11-button-indexed, but that could be changed without too
> much hassle.

long story short - it doesn't really matter. we're mostly just
arguing about the wording in a commit message and I seem to be doing a
better job at confusing you than explaining myself :) I take it that
the behaviour of the strip can be set with actions now (including "button 5"
or somesuch). so to me, the matter is resolved.

Cheers,
  Peter

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] ISDV4: work around Levono X200/X201 pressure issues

2011-04-04 Thread Peter Hutterer
On Mon, Apr 04, 2011 at 02:59:45PM -0500, Chris Bagwell wrote:
> On Sun, Apr 3, 2011 at 6:35 PM, Peter Hutterer  
> wrote:
> > On Sat, Apr 02, 2011 at 09:14:50AM -0500, ch...@cnpbagwell.com wrote:
> >> From: Chris Bagwell 
> >>
> >> As reported on mailing list and bug tracker #3008864, some
> >> Levono tablets pressure is not working right.  Some people
> >> notice as getting max pressure while pressing lightly and
> >> others report as pressure curve not working.
> >>
> >> The basic issue is hardware is reporting maximum pressure of
> >> 127 but returning 254 values.  This throws off normalization
> >> and pressure curves both.
> >>
> >> Adjust dynamically when higher pressure values are seen so
> >> that we do not need to maintain a quirks list of hardware.
> >> Kernel driver would need quirks list.
> >>
> >> Signed-off-by: Chris Bagwell 
> >> ---
> >>
> >> This is RFC patch.
> >>
> >> The concept has been tested by user on mailing list hard coding
> >> pressure to 254 but this tries to do it dynamically so it can
> >> ship with xf86-input-wacom.
> >>
> >> Another option is to add list on wiki of problem hardware and
> >> explain how to edit config file and for MaxZ to 254 for stylus
> >> and eraser.
> >
> > can we detect this tablet and put a quirk in? any hardware string we can go
> > by?
> 
> Since we know its two models of Levono, I suppose we could check
> /sys/class/dmi/id/product_name.

maybe it's best if we include a default config quirk then. We just need to
figure out which MatchFoobar is appropriate here, cause I keep forgetting :)

Cheers,
  Peter

> > as-is, this patch is quite iffy. we can't guarantee that other tablets
> > have 127 as the correct maximum and are affected by this. Nonetheless,
> > growing the pressure range if the reported value is higher than the max
> > value seems like a good approach.
> 
> I'm thinking now to simplify it.  Instead of trying to be smart, If it
> see's unexpected pressure value then print a message to log to suggest
> user create config file and set MaxZ option to fix issue.  It can
> still update MaxZ to keep lon from being spammed to much and to
> somewhat auto-recover.
> 
> The bug report was just updated confirming MaxZ config option is a
> working solution.
> 
> >
> > Cheers,
> >  Peter
> >
> >>  src/wcmISDV4.c |   17 +
> >>  1 files changed, 17 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
> >> index db0d83e..c81f2d5 100644
> >> --- a/src/wcmISDV4.c
> >> +++ b/src/wcmISDV4.c
> >> @@ -721,6 +721,23 @@ static int isdv4Parse(InputInfoPtr pInfo, const 
> >> unsigned char* data, int len)
> >>               /* pressure */
> >>               ds->pressure = coord.pressure;
> >>
> >> +             /* Work around issue with Levono tablets reporting
> >> +              * max pressure of 127 but returning higher values.
> >> +              */
> >> +             if (coord.pressure > common->wcmMaxZ)
> >> +             {
> >> +                     /* For sepecific Levono issues, we can jump straight
> >> +                      * to real max pressure. If higher resolution tablets
> >> +                      * have same issue, slowly adjust.
> >> +                      */
> >> +                     if (common->wcmMaxZ == 127)
> >> +                             common->wcmMaxZ = 254;
> >> +                     else
> >> +                             common->wcmMaxZ = coord.pressure;
> >> +                     DBG(2, priv, "pressure higher than maxZ sent. "
> >> +                         "new maxZ=%d", common->wcmMaxZ);
> >> +             }
> >> +
> >>               /* buttons */
> >>               ds->buttons = coord.tip | (coord.side << 1) | (coord.eraser 
> >> << 2);
> >>
> >> --
> >> 1.7.4.2
> >
> 

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] ISDV4: work around Levono X200/X201 pressure issues

2011-04-04 Thread Chris Bagwell
On Sun, Apr 3, 2011 at 6:35 PM, Peter Hutterer  wrote:
> On Sat, Apr 02, 2011 at 09:14:50AM -0500, ch...@cnpbagwell.com wrote:
>> From: Chris Bagwell 
>>
>> As reported on mailing list and bug tracker #3008864, some
>> Levono tablets pressure is not working right.  Some people
>> notice as getting max pressure while pressing lightly and
>> others report as pressure curve not working.
>>
>> The basic issue is hardware is reporting maximum pressure of
>> 127 but returning 254 values.  This throws off normalization
>> and pressure curves both.
>>
>> Adjust dynamically when higher pressure values are seen so
>> that we do not need to maintain a quirks list of hardware.
>> Kernel driver would need quirks list.
>>
>> Signed-off-by: Chris Bagwell 
>> ---
>>
>> This is RFC patch.
>>
>> The concept has been tested by user on mailing list hard coding
>> pressure to 254 but this tries to do it dynamically so it can
>> ship with xf86-input-wacom.
>>
>> Another option is to add list on wiki of problem hardware and
>> explain how to edit config file and for MaxZ to 254 for stylus
>> and eraser.
>
> can we detect this tablet and put a quirk in? any hardware string we can go
> by?

Since we know its two models of Levono, I suppose we could check
/sys/class/dmi/id/product_name.

>
> as-is, this patch is quite iffy. we can't guarantee that other tablets
> have 127 as the correct maximum and are affected by this. Nonetheless,
> growing the pressure range if the reported value is higher than the max
> value seems like a good approach.

I'm thinking now to simplify it.  Instead of trying to be smart, If it
see's unexpected pressure value then print a message to log to suggest
user create config file and set MaxZ option to fix issue.  It can
still update MaxZ to keep lon from being spammed to much and to
somewhat auto-recover.

The bug report was just updated confirming MaxZ config option is a
working solution.

>
> Cheers,
>  Peter
>
>>  src/wcmISDV4.c |   17 +
>>  1 files changed, 17 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
>> index db0d83e..c81f2d5 100644
>> --- a/src/wcmISDV4.c
>> +++ b/src/wcmISDV4.c
>> @@ -721,6 +721,23 @@ static int isdv4Parse(InputInfoPtr pInfo, const 
>> unsigned char* data, int len)
>>               /* pressure */
>>               ds->pressure = coord.pressure;
>>
>> +             /* Work around issue with Levono tablets reporting
>> +              * max pressure of 127 but returning higher values.
>> +              */
>> +             if (coord.pressure > common->wcmMaxZ)
>> +             {
>> +                     /* For sepecific Levono issues, we can jump straight
>> +                      * to real max pressure. If higher resolution tablets
>> +                      * have same issue, slowly adjust.
>> +                      */
>> +                     if (common->wcmMaxZ == 127)
>> +                             common->wcmMaxZ = 254;
>> +                     else
>> +                             common->wcmMaxZ = coord.pressure;
>> +                     DBG(2, priv, "pressure higher than maxZ sent. "
>> +                         "new maxZ=%d", common->wcmMaxZ);
>> +             }
>> +
>>               /* buttons */
>>               ds->buttons = coord.tip | (coord.side << 1) | (coord.eraser << 
>> 2);
>>
>> --
>> 1.7.4.2
>

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [linuxwacom-announce] [ANNOUNCE] xf86-input-wacom 0.10.99.1

2011-04-04 Thread Jason Gerecke
On Sun, Apr 3, 2011 at 10:42 PM, Peter Hutterer
 wrote:
> On Mon, Apr 04, 2011 at 07:32:44AM +0200, Andrzej Giniewicz wrote:
>> > are you scrolling through gestures? afaict the scrolling code is hardcoded
>> > to use 4/5 6/7 instead of the button mapping.
>>
>> yes, that was of course using gestures. It worked in 0.10.11 so I
>> believe it was recent change to hardcode it?
>
> what changed was the way how xsetwacom worked. it used to set the X logical
> button mapping but that's not the case anymore for simple button
> mappings.
>
> Jason can tell you more but in the meantime xinput set-button-map "device
> name" ... will get you there.
>
> Cheers,
>  Peter
>

If gesture code is hardcoded to use 4/5 (or to use e.g. relup/reldn)
then that would actually explain the bug perfectly. Like Peter said,
`xinput set-button-map` should work around the issue for now, but I'll
try to see if I can get my hands on a bamboo and find where/how
gestures are handled.

Jason

---
Day xee-nee-svsh duu-'ushtlh-ts'it;
nuu-wee-ya' duu-xan' 'vm-nvshtlh-ts'it.
Huu-chan xuu naa~-gha.

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 5/7] Decrease minimum number of args to 'set' [allow wheels/strips "reset"]

2011-04-04 Thread Jason Gerecke
On Sun, Apr 3, 2011 at 8:26 PM, Peter Hutterer  wrote:
> On Fri, Apr 01, 2011 at 11:17:15AM -0700, Jason Gerecke wrote:
>> On Thu, Mar 31, 2011 at 9:21 PM, Peter Hutterer
>>  wrote:
>> > On Wed, Mar 30, 2011 at 11:51:22PM -0700, Jason Gerecke wrote:
>> >> On Wed, Mar 30, 2011 at 9:04 PM, Peter Hutterer
>> >>  wrote:
>> >> > On Wed, Mar 30, 2011 at 01:54:45PM -0700, Jason Gerecke wrote:
>> >> >> Since the worker functions now check that they have the appropriate
>> >> >> number of arguments, its possible to decrease the number of arguments
>> >> >> required by 'set'. Since all it really needs is a device number and
>> >> >> a property, the minimum argc is now 2.
>> >> >>
>> >> >> A handy side-effect of this change is that its now possible to run
>> >> >> e.g. `xsetwacom --set $ID StripLeftDown` to reset the action to
>> >> >> its default.
>> >> >
>> >> > is that because we delete the property then so it falls back to using 
>> >> > the
>> >> > button mapping?
>> >> >
>> >> Correct.
>> >>
>> >> > this formulation is a bit unfortunate, since it doesn't actually set to 
>> >> > the
>> >> > default. if I map the button to say 8, then run the above command it 
>> >> > would
>> >> > revert back to 8, not to the default (4 or whatever it is), right?
>> >> >
>> >> > Cheers,
>> >> >  Peter
>> >> >
>> >> I'm not quite sure what you mean here. If no action has been defined,
>> >> the driver falls back to its predefined button. If you run e.g.
>> >> `xsetwacom --set $ID LeftStripUp 8`, the action "button +8" is
>> >> assigned (because of parse_action's simple button handling). When you
>> >> move your finger along the strip, the driver notices an action has
>> >> been set and will send the button 8 event. If you then run `xsetwacom
>> >> --set $ID LeftStripUp` the action is deleted. Moving your finger along
>> >> the strip again, the driver will not find an action and fall back to
>> >> its predefined mapping (which should be button 5)
>> >
>> > Where is this 5 coming from? shouldn't this be the equivalent of "button
>> > +5" in the driver?
>> >
>> > Cheers,
>> >  Peter
>> >
>> getWheelButton (in wcmCommon.c) is responsible for finding both the
>> "fakeButton" and "fakeKey" that could be associated with various
>> device events. In the case of our hypothetical "strip left up", it
>> gets the button from 'priv->striplup' and the key from
>> 'priv->strip_keys[0]'. The former is defined during wcmAllocate and is
>> never changed.
>
> in spirit with the other discussion of allowing physical mappings, this
> should probably be adjustable.
>
See my reply below :)

>> The latter is changed by wcmUpdateButtonKeyActions
>> (after a long call chain beginning with wcmSetProperty) whenever X
>> detects a change in the WACOM_PROP_STRIPBUTTONS property.
>> getWheelButton then returns both of these to sendWheelStripEvents. If
>> a "key" is defined, it will preferentially decode it and send the
>> necessary events. Otherwise, it interprets the raw integer fakeButton
>> as the X button to send a button press event for.
>>
>> When xsetwacom is given arguments to StripLeftUp, it converts them
>> into an action and modifies the appropriate offset into
>> WACOM_PROP_STRIPBUTTONS. When the appropriate motion is made the
>> driver notices an action is sent and sends it. When it is run without
>> arguments, it clears the offset, so the same motion results in the
>> driver not finding an action and sending the default button. Note that
>> xsetwacom works the same way for "Button X"! Running with arguments
>> sets an action the driver will preferentially use; running without
>> arguments clears the action, forcing the driver to fall back on the
>> raw integer defined in the button[] array.
>
> right, so if I understand this correctly, the "default button" it uses then
> is the (essentially hardcoded) striplup value. which brings me back to my
> original question: it doesn't reset to the default value but rather removes
> the new button mapping.  if you could change striplup, removing a button
> mapping would reset to whatever striplup has as current value (and that may
> not be the _default_). currently this works, but only because we don't seem
> to have a way to change it. it's really just the wording that matters to me
> here, even if it appears to be overly anal :)
>
I see now -- yes, you are understanding things correctly.

However, In regards to this and your prior paragraph, I'm not sure I
see the logic in letting the user change striplup. Why /should/ the
user be able to modify it? If they don't like the mapping, why not use
already-extant features like setting an action (i.e. modify
strip_keys[0])? I've tried thinking of several possible motivations,
but am coming up blank :(

Also, what did you mean by "in spirit with the other discussion of
allowing physical mappings"? I'm not sure I understand since the
button[] array is already physical-button-indexed and the strip_keys[]
and wheel_keys[] don't really /have/ physical buttons... IIR