Disable tablet flicks under MS Windows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 34cbcac..844b913 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -40,6 +40,11 @@
/* For GET_X_LPARAM, GET_Y_LPARAM. */
#include <windowsx.h>
+/* For WM_TABLET_QUERYSYSTEMGESTURESTATUS et. al. */
+#if HAVE_TPCSHRD_H
+#include <tpcshrd.h>
+#endif /* HAVE_TPCSHRD_H */
+
/* #define WMMSG_DEBUG */
#ifdef WMMSG_DEBUG
#include <stdio.h>
@@ -1285,6 +1290,25 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
+#if HAVE_TPCSHRD_H
+
+ case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
+ /* See https://msdn.microsoft.com/en-us/library/windows/desktop/bb969148(v=vs.85).aspx .
+ * If we're handling our own touches, we don't want any gestures.
+ * Not all of these settings are documented.
+ * The use of the undocumented ones was suggested by https://github.com/bjarkeck/GCGJ/blob/master/Monogame/Windows/WinFormsGameForm.cs . */
+ return TABLET_DISABLE_PRESSANDHOLD | /* disables press and hold (right-click) gesture */
+ TABLET_DISABLE_PENTAPFEEDBACK | /* disables UI feedback on pen up (waves) */
+ TABLET_DISABLE_PENBARRELFEEDBACK | /* disables UI feedback on pen button down (circle) */
+ TABLET_DISABLE_TOUCHUIFORCEON |
+ TABLET_DISABLE_TOUCHUIFORCEOFF |
+ TABLET_DISABLE_TOUCHSWITCH |
+ TABLET_DISABLE_FLICKS | /* disables pen flicks (back, forward, drag down, drag up) */
+ TABLET_DISABLE_SMOOTHSCROLLING |
+ TABLET_DISABLE_FLICKFALLBACKKEYS;
+
+#endif /* HAVE_TPCSHRD_H */
+
case WM_DROPFILES:
{
UINT i;