Re[4]: Support for graphical tablets

Vadim Zeitlin <[email protected]> Mon, 26 Jan 2026 22:09:18 +0100
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Mon, 26 Jan 2026 16:30:23 +0200 Iulian-Nicu Şerbănoiu wrote:

IN> For Windows:
IN> https://learn.microsoft.com/en-us/windows/win32/inputmsg/wmpointer-reference
IN> For Linux (gtk):
IN> https://developer-docs.wacom.com/docs/icbt/linux/gtk/gtk-reference/
IN> 
IN> So the common events would be:
IN> 
IN> move
IN> pendown
IN> pen up

 Just for completeness: we could support events specific to just one of the
platforms too, they would only need to be documented as specific to that
platform.

IN> information that should be passed to the event:
IN> 
IN> https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info
IN> & https://docs.gtk.org/gdk4/enum.AxisUse.html

 Note that we're still using GTK/GDK 3.

IN> x,y, xTilt,yTilt, pressure.

 Windows seems to provide a pretty useful "eraser button pressed" flag,
so I'd provide the possibility to pass it on.

IN> From what I saw there are ways to differentiate between these events and
IN> normal mouse events:
IN> -
IN> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getpointertype
IN> ( +
IN> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-get_pointerid_wparam
IN> )
IN> - https://docs.gtk.org/gdk4/method.Device.get_source.html
IN> 
IN> So we have multiple inputs:
IN> 
IN> https://docs.gtk.org/gdk4/enum.InputSource.html &
IN> https://learn.microsoft.com/en-us/windows/win32/api/winuser/ne-winuser-tagpointer_input_type
IN> 
IN> - mouse
IN> - pen
IN> - touch (screen?)
IN> - pad

 We handle only a single mouse and a single source of touch input
currently, so I guess we should handle only a single pad too, even if I
could imagine using more than one simultaneously (more easily than using 2
mice).

IN> My take would be to generate some new events wxTabletEvent which contain
IN> the even information mentioned above.

 It looks like both Windows and GTK use "pad" for these devices, so maybe
wxTouchPadEvent? Or would this be confusing/overlapping with the existing
wxMultiTouchEvent (BTW, it looks like Wacom tablets can also generate what
we call wxGestureEvent too)? Speaking of touch events, you should probably
add some demonstration of the new events into the existing touchtest
sample.

 Anyhow, it definitely looks like it would be nice, and suitable for wx, to
add support to allow writing cross-platform code using such devices, so I'm
looking forward to seeing it.

 Good luck!
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
              https://www.tt-solutions.com/
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaXfX/gAKCRAG6kHeT2we
hrIhAJwP+Sr5WiPFay20uJ/0lYDxe3nivgCeOCxv46It8vdXCcTFz1n7Fxg6wtE=
=VDh6
-----END PGP SIGNATURE-----