From 4c4693cf964e9d7370c27a26e1d263a262aee568 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Tue, 31 Mar 2020 07:41:45 +0200 Subject: Windows: Provide a way to switch between WinTab and Windows Ink at run-time This change adds the setWinTabEnabled() function to Qt Platform Headers, which allows an application to set at run-time whether the WinTab API will be used for tablet input instead of the native Windows Ink API. [ChangeLog][Windows] The setWinTabEnabled() function added to Qt Platform Headers now allows an application to set at run-time whether the WinTab API will be used for tablet input instead of the native Windows Ink API. Fixes: QTBUG-83218 Change-Id: I51d3c7316baeda136763cf37c2f54295905450ec Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge Reviewed-by: Oliver Wolff --- src/platformheaders/windowsfunctions/qwindowswindowfunctions.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/platformheaders/windowsfunctions/qwindowswindowfunctions.h') diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h index 032dcafa6e..722f640a13 100644 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h @@ -108,6 +108,14 @@ public: IsTabletModeType func = reinterpret_cast(QGuiApplication::platformFunction(isTabletModeIdentifier())); return func && func(); } + + typedef bool (*SetWinTabEnabled)(bool enabled); + static const QByteArray setWinTabEnabledIdentifier() { return QByteArrayLiteral("WindowsSetWinTabEnabled"); } + static bool setWinTabEnabled(bool enabled) + { + SetWinTabEnabled func = reinterpret_cast(QGuiApplication::platformFunction(setWinTabEnabledIdentifier())); + return func && func(enabled); + } }; Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsWindowFunctions::TouchWindowTouchTypes) -- cgit v1.2.3