Re: Re[4]: Support for graphical tablets

Iulian-Nicu Şerbănoiu <[email protected]> Tue, 3 Feb 2026 09:27:00 +0200
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <CAJ5uX7rRN_wZ40BY8AXyw3+gW9+Q7kjHdhg3_BOz4PVTEpkEdA@mail.gmail.com>
Hi,

I return with a quick update on the status as I managed to have some spare
time this weekend.

The Windows integration is working fine with a sample code taking into
account the pressure when making basic drawing.
A new drawing sample copied from an existing one is working fine
with event macros - haven't tested with Bind, probably it works as I
rigorously copy pasted from other events.

I have the tilt (x,y), pressure, rotation, position correctly transferred
to the newly created event - only pressure testable because of my tablet
device.

What remains is: the button state and the erasing part (from some flags -
even though I don't have that capability in my "One by Wacom" tablet).

Should I make a pull request with what I have so far, or should I finish it
completely?

NOTE: I only have this tablet to test on so if there are others with such
devices, their support is welcome.

Do you have any other thoughts on what should be added?

Br,
Iulian

PS: For wxPython, since I also use it, should I also help with the new
feature there or is there an automated way to import the event  / sync with
the C++ wxWidgets code base?

PPS:  wxFormBuilder, my GUI builder of choice, are there any developers on
this list that can add this new event? I can also make it, of course, but
not very fast.

On Mon, Jan 26, 2026 at 11:09 PM Vadim Zeitlin <[email protected]> wrote:

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

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/CAJ5uX7rRN_wZ40BY8AXyw3%2BgW9%2BQ7kjHdhg3_BOz4PVTEpkEdA%40mail.gmail.com.