Re: [Linuxwacom-devel] [PATCH 3/3] Reset filter when buttons are pressed
On Tue, Dec 12, 2017 at 4:49 PM, Ping Chengwrote: > Thank you for your cleanup work, Jason. The first two patches look fine. > This one definitely needs some testing to make sure it achieves what you > planned for. > > Assuming your testing of this patch was successfully, the whole set is; > > Reviewed-by: Ping Cheng > > With one question below. > > On Fri, Dec 8, 2017 at 1:55 PM, Jason Gerecke wrote: >> >> Coordinate averaging is useful for producing smooth strokes, but this >> averaging can cause button events to be sent at the wrong location. >> In particular, when making a series of quick strokes with an AES pen, >> the actual location the pen contacts the display can be some distance >> away from the first (low-quality) position report. This can result in >> "hook" artifacts if it is still influencing the averaged pointer >> position when the pen goes down. >> >> To prevent these artifacts from appearing, we reset the averaging filter >> whenever a button is pressed. This ensures that button events are sent >> at the pen's actual location, plus or minus some (much smaller) noise. >> Resetting the filter should not significantly impact stroke quality since >> buttons are rarely pressed mid-stroke. >> >> https://sourceforge.net/p/linuxwacom/bugs/338/ >> >> Signed-off-by: Jason Gerecke >> --- >> src/wcmCommon.c | 9 + >> 1 file changed, 9 insertions(+) >> >> diff --git a/src/wcmCommon.c b/src/wcmCommon.c >> index 900544b..e515078 100644 >> --- a/src/wcmCommon.c >> +++ b/src/wcmCommon.c >> @@ -1241,6 +1241,15 @@ static void commonDispatchDevice(InputInfoPtr >> pInfo, >> if (!priv->oldState.proximity) >> wcmResetSampleCounter(pChannel); >> >> + /* Reset filter whenever a button is pressed to > > > Shouldn't we do it for button release too? Some actions may be trigged by > button release instead. > Hmm, that's an interesting question... Having actions trigger at the actual pen position instead of its averaged position sounds valuable, but I do worry a little that it could result in hooks at the end of strokes. I'm not sure it would be a problem with a normal amount of averaging, but it would definitely be more pronounced as its increased. I'll have to do some experimentation... Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three,/ So you look at the sixty-fours >> +* ensure the clicks are sent at the pen's actual >> +* position. This prevents "hooks" from appearing >> +* at the beginning of series of rapidly-drawn or >> +* highly-averaged strokes. >> +*/ >> + if ((priv->oldState.buttons ^ filtered.buttons) & >> filtered.buttons) > > > So, is the second filtered.buttons necessary above? > > Cheers, > Ping > >> + wcmResetSampleCounter(pChannel); >> + >> wcmFilterCoord(common,pChannel,); >> } >> >> -- >> 2.15.1 >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
Re: [Linuxwacom-devel] [PATCH 3/3] Reset filter when buttons are pressed
Thank you for your cleanup work, Jason. The first two patches look fine. This one definitely needs some testing to make sure it achieves what you planned for. Assuming your testing of this patch was successfully, the whole set is; Reviewed-by: Ping ChengWith one question below. On Fri, Dec 8, 2017 at 1:55 PM, Jason Gerecke wrote: > Coordinate averaging is useful for producing smooth strokes, but this > averaging can cause button events to be sent at the wrong location. > In particular, when making a series of quick strokes with an AES pen, > the actual location the pen contacts the display can be some distance > away from the first (low-quality) position report. This can result in > "hook" artifacts if it is still influencing the averaged pointer > position when the pen goes down. > > To prevent these artifacts from appearing, we reset the averaging filter > whenever a button is pressed. This ensures that button events are sent > at the pen's actual location, plus or minus some (much smaller) noise. > Resetting the filter should not significantly impact stroke quality since > buttons are rarely pressed mid-stroke. > > https://sourceforge.net/p/linuxwacom/bugs/338/ > > Signed-off-by: Jason Gerecke > --- > src/wcmCommon.c | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/src/wcmCommon.c b/src/wcmCommon.c > index 900544b..e515078 100644 > --- a/src/wcmCommon.c > +++ b/src/wcmCommon.c > @@ -1241,6 +1241,15 @@ static void commonDispatchDevice(InputInfoPtr > pInfo, > if (!priv->oldState.proximity) > wcmResetSampleCounter(pChannel); > > + /* Reset filter whenever a button is pressed to > Shouldn't we do it for button release too? Some actions may be trigged by button release instead. +* ensure the clicks are sent at the pen's actual > +* position. This prevents "hooks" from appearing > +* at the beginning of series of rapidly-drawn or > +* highly-averaged strokes. > +*/ > + if ((priv->oldState.buttons ^ filtered.buttons) & > filtered.buttons) > So, is the second filtered.buttons necessary above? Cheers, Ping + wcmResetSampleCounter(pChannel); > + > wcmFilterCoord(common,pChannel,); > } > > -- > 2.15.1 > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
[Linuxwacom-devel] [PATCH 3/3] Reset filter when buttons are pressed
Coordinate averaging is useful for producing smooth strokes, but this averaging can cause button events to be sent at the wrong location. In particular, when making a series of quick strokes with an AES pen, the actual location the pen contacts the display can be some distance away from the first (low-quality) position report. This can result in "hook" artifacts if it is still influencing the averaged pointer position when the pen goes down. To prevent these artifacts from appearing, we reset the averaging filter whenever a button is pressed. This ensures that button events are sent at the pen's actual location, plus or minus some (much smaller) noise. Resetting the filter should not significantly impact stroke quality since buttons are rarely pressed mid-stroke. https://sourceforge.net/p/linuxwacom/bugs/338/ Signed-off-by: Jason Gerecke--- src/wcmCommon.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 900544b..e515078 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -1241,6 +1241,15 @@ static void commonDispatchDevice(InputInfoPtr pInfo, if (!priv->oldState.proximity) wcmResetSampleCounter(pChannel); + /* Reset filter whenever a button is pressed to +* ensure the clicks are sent at the pen's actual +* position. This prevents "hooks" from appearing +* at the beginning of series of rapidly-drawn or +* highly-averaged strokes. +*/ + if ((priv->oldState.buttons ^ filtered.buttons) & filtered.buttons) + wcmResetSampleCounter(pChannel); + wcmFilterCoord(common,pChannel,); } -- 2.15.1 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel