Compatibility
On which platforms does GTK+ support tablet input?
The GTK+ toolkit supports tablet input on Windows, Mac OS, and Linux (Xorg / Wayland) platforms. Wayland support requires the use of a compositor which implements the Wayland Tablet Protocol, and GTK+ >= 3.22.
Which tablets are compatible with GTK+?
GTK+ should be compatible with any tablet which is supported by your platform's Wacom tablet drivers.
Which versions of GTK+ support tablet input?
All versions of GTK+ 3.x support tablet input. If using GTK+ on a Linux platform with a Wayland compositor, use of GTK+ >= 3.22 is required. GTK+ 2.x also supports tablet input, but is not recommended.
What are some example open-source GTK+ applications which use tablet input?
MyPaint and Xournal++ are two open-source applications which use modern GTK+ 3.x APIs for tablet input. Studying them may provide insight to effective use of the toolkit.
Tablet APIs
Do I need to set the device mode for tablets, like in GTK+ 2.x?
The GTK+ 3.x API includes gdk_device_set_mode()
and gdk_device_get_mode()
functions similar to GTK+ 2.x. Use of these functions were required in 2.x in order to gain access to axis data. This is no longer required in GTK+ 3.x.
What is the difference between the GdkDevice "screen" and "window" modes?
The GdkInputMode
enumeration defines three values: GDK_MODE_DISABLED
, GDK_MODE_SCREEN
and GDK_MODE_WINDOW
. Setting these modes is not typically required anymore under GTK+3. The difference between the "screen" and "window" modes is how the toolkit will report device coordinates to your application. In "screen" mode, coordinates are reported as though the tablet were mapped to the entire desktop. This is the most common case and often results in the expected behavior. In "window" mode, coordinates are reported as though the tablet were mapped to just the program window. This may allow the entire tablet active area to be used within the application, but only if supported by the platform. This mode is rarely used.
How are events from the ExpressKeys, Touch Ring, etc. reported to my application?
Under most platforms, the Wacom tablet driver reports keyboard and mouse events in response to "pad" input (i.e. input events from controls on the tablet surface). On platforms where this is the case, pad events will be reported as whatever keyboard or mouse event was programmed into the driver. On platforms which report the pad as a distinct class of input device (most notably Wayland), GTK+ >= 3.22 provides APIs for handling pad events abstractly, free from driver-prescribed behavior. See GdkDevicePad
, GtkPadController
, and new subtypes of GdkEvent
.
Miscellaneous
How can I configure the tablet through GTK+?
The GTK+ toolkit provides a way for applications to respond to tablet input events. It does not provide a way for applications to configure the tablet itself. If you are building a tablet control panel, you will need to make use of platform-specific libraries and utilities (if available) to change the tablet behavior. For other types of applications, you may interpret the tablet events however you see fit and provide whatever behavior you would like.