On Tue, Nov 07, 2017 at 08:33:34AM -0800, Jason Gerecke wrote:
> BTN_STYLUS3 was (will be) added to the Linux 4.15 kernel to support the
> third button present on Wacom's "Pro Pen 3D" stylus. This commit adds
> support for this new event, mapping it to mouse button 8 ("navigate
> back"). Remapping this button to a different function is possible by
> using commands like `xsetwacom set <id> button 8 <action>`.
> 
> Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>

Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>

though I'm wondering whether we should just add input-event-codes.h instead
of relying on manual ifdefs.

Cheers,
   Peter

> ---
>  src/wcmUSB.c        | 4 ++++
>  src/xf86WacomDefs.h | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/src/wcmUSB.c b/src/wcmUSB.c
> index 0b5ec57..2f96a8a 100644
> --- a/src/wcmUSB.c
> +++ b/src/wcmUSB.c
> @@ -1454,6 +1454,10 @@ static void usbParseKeyEvent(WacomCommonPtr common,
>                       ds->buttons = mod_buttons(ds->buttons, 2, event->value);
>                       break;
>  
> +             case BTN_STYLUS3:
> +                     ds->buttons = mod_buttons(ds->buttons, 3, event->value);
> +                     break;
> +
>               default:
>                       change = 0;
>       }
> diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
> index ec34211..a772597 100644
> --- a/src/xf86WacomDefs.h
> +++ b/src/xf86WacomDefs.h
> @@ -93,6 +93,12 @@
>  #define ABS_MT_SLOT 0x2f
>  #endif
>  
> +/* 4.15 */
> +
> +#ifndef BTN_STYLUS3
> +#define BTN_STYLUS3 0x149
> +#endif
> +
>  
> /******************************************************************************
>   * Forward Declarations
>   
> *****************************************************************************/
> -- 
> 2.15.0
> 
> 
> ------------------------------------------------------------------------------
> 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
> 

------------------------------------------------------------------------------
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

Reply via email to