Skip to content

Commit d7873e6

Browse files
ulatekhslouken
authored andcommitted
Disable tablet flicks under MS Windows.
1 parent 15ebad6 commit d7873e6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/video/windows/SDL_windowsevents.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
/* For GET_X_LPARAM, GET_Y_LPARAM. */
4141
#include <windowsx.h>
4242

43+
/* For WM_TABLET_QUERYSYSTEMGESTURESTATUS et. al. */
44+
#if HAVE_TPCSHRD_H
45+
#include <tpcshrd.h>
46+
#endif /* HAVE_TPCSHRD_H */
47+
4348
/* #define WMMSG_DEBUG */
4449
#ifdef WMMSG_DEBUG
4550
#include <stdio.h>
@@ -1285,6 +1290,25 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
12851290
}
12861291
break;
12871292

1293+
#if HAVE_TPCSHRD_H
1294+
1295+
case WM_TABLET_QUERYSYSTEMGESTURESTATUS:
1296+
/* See https://msdn.microsoft.com/en-us/library/windows/desktop/bb969148(v=vs.85).aspx .
1297+
* If we're handling our own touches, we don't want any gestures.
1298+
* Not all of these settings are documented.
1299+
* The use of the undocumented ones was suggested by https://github.com/bjarkeck/GCGJ/blob/master/Monogame/Windows/WinFormsGameForm.cs . */
1300+
return TABLET_DISABLE_PRESSANDHOLD | /* disables press and hold (right-click) gesture */
1301+
TABLET_DISABLE_PENTAPFEEDBACK | /* disables UI feedback on pen up (waves) */
1302+
TABLET_DISABLE_PENBARRELFEEDBACK | /* disables UI feedback on pen button down (circle) */
1303+
TABLET_DISABLE_TOUCHUIFORCEON |
1304+
TABLET_DISABLE_TOUCHUIFORCEOFF |
1305+
TABLET_DISABLE_TOUCHSWITCH |
1306+
TABLET_DISABLE_FLICKS | /* disables pen flicks (back, forward, drag down, drag up) */
1307+
TABLET_DISABLE_SMOOTHSCROLLING |
1308+
TABLET_DISABLE_FLICKFALLBACKKEYS;
1309+
1310+
#endif /* HAVE_TPCSHRD_H */
1311+
12881312
case WM_DROPFILES:
12891313
{
12901314
UINT i;

0 commit comments

Comments
 (0)