On Wed, Aug 10, 2011 at 6:24 PM, Peter Hutterer
<peter.hutte...@who-t.net> wrote:
> On Tue, Aug 09, 2011 at 05:31:41PM -0700, Jason Gerecke wrote:
>> Supports AC_PRESSUREHOLD by adding a 'holdPressure' variable to
>> the '_WacomDeviceRec' struct. When non-negative, the value of
>> this variable will be used in place of pressure being reported
>> by the hardware.
>
> I think 2 and 3 can easily be squashed together without causing confusion,
> they belong to the same logical change after all. One thing I'd like to see
> though is a man page addition and wait for what the result is of the
> AC_CUSTOM argument I brought up in the other email.

Can do. I originally had them separated to try a few different ways of
implementing pressure hold in the driver. I'll squash them and work on
a patch to the man page as well (I knew I was forgetting something!)

Jason

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

>> ---
>>  src/wcmCommon.c     |   11 +++++++++++
>>  src/xf86Wacom.c     |    1 +
>>  src/xf86WacomDefs.h |    6 ++++++
>>  3 files changed, 18 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/wcmCommon.c b/src/wcmCommon.c
>> index 95dbb90..0689abc 100644
>> --- a/src/wcmCommon.c
>> +++ b/src/wcmCommon.c
>> @@ -203,6 +203,7 @@ static void sendAction(InputInfoPtr pInfo, int press,
>>                      unsigned int *keys, int nkeys,
>>                      int first_val, int num_val, int *valuators)
>>  {
>> +     WacomDevicePtr priv = (WacomDevicePtr) pInfo->private;
>>       int i;
>>
>>       /* Actions only trigger on press, not release */
>> @@ -237,6 +238,10 @@ static void sendAction(InputInfoPtr pInfo, int press,
>>                                       wcmDevSwitchModeCall(pInfo,
>>                                                       (is_absolute(pInfo)) ? 
>> Relative : Absolute); /* not a typo! */
>>                               break;
>> +                     case AC_PRESSUREHOLD:
>> +                             DBG(4, priv, "Pressure hold ENABLED at p=%d", 
>> priv->oldZ);
>> +                             priv->holdPressure = priv->oldZ;
>> +                             break;
>>               }
>>       }
>>
>> @@ -273,6 +278,10 @@ static void sendAction(InputInfoPtr pInfo, int press,
>>                                       if (countPresses(key_code, &keys[i], 
>> nkeys - i))
>>                                               wcmEmitKeycode(pInfo->dev, 
>> key_code, 0);
>>                               }
>> +                     case AC_PRESSUREHOLD:
>> +                             DBG(4, priv, "Pressure hold DISABLED");
>> +                             priv->holdPressure = -1;
>> +                             break;
>>               }
>>
>>       }
>> @@ -1174,6 +1183,8 @@ static void commonDispatchDevice(WacomCommonPtr 
>> common, unsigned int channel,
>>               if (IsPen(priv))
>>                       filtered.buttons = setPressureButton(priv, &filtered);
>>               filtered.pressure = applyPressureCurve(priv,&filtered);
>> +             if (priv->holdPressure >= 0)
>> +                     filtered.pressure = priv->holdPressure;
>>               if (IsPen(priv))
>>                       common->wcmPenInProx = filtered.proximity;
>>       }
>> diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
>> index 16561b5..8090e8d 100644
>> --- a/src/xf86Wacom.c
>> +++ b/src/xf86Wacom.c
>> @@ -436,6 +436,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
>>       {
>>               wcmInitialToolSize(pInfo);
>>               wcmMappingFactor(pInfo);
>> +             priv->holdPressure = -1;
>>       }
>>
>>       if (!wcmInitAxes(pWcm))
>> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
>> index 94eee2e..9980202 100644
>> --- a/src/xf86WacomDefs.h
>> +++ b/src/xf86WacomDefs.h
>> @@ -320,6 +320,12 @@ struct _WacomDeviceRec
>>       Atom strip_actions[4];
>>
>>       OsTimerPtr serial_timer; /* timer used for serial number property 
>> update */
>> +
>> +     /* If negative, pressure hold is disabled and the driver will report
>> +      * actual HW pressure. Otherwise, pressure hold is enabled and the
>> +      * value contained is used in lieu of HW pressure.
>> +      */
>> +     int holdPressure;
>>  };
>>
>>  /******************************************************************************
>> --
>> 1.7.5.2
>>
>

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to