Browse Source

Added 'JUCE_USE_WINDOWS_POINTER_API' flag to juce_gui_basics.h to enable/disable the advanced Windows pointer API (only available on Windows 8 and above).

tags/2021-05-28
ed 8 years ago
parent
commit
f855806602
2 changed files with 14 additions and 2 deletions
  1. +8
    -0
      modules/juce_gui_basics/juce_gui_basics.h
  2. +6
    -2
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 8
- 0
modules/juce_gui_basics/juce_gui_basics.h View File

@@ -107,6 +107,14 @@
#define JUCE_USE_XCURSOR 1
#endif
/** Config: JUCE_USE_WINDOWS_POINTER_API
Enables the Windows pointer input API for advanced touch and pen input. This is only available on Windows 8
and above so disable this if you are using earlier versions of Windows.
*/
#ifndef JUCE_USE_WINDOWS_POINTER_API
#define JUCE_USE_WINDOWS_POINTER_API 0
#endif
//==============================================================================
namespace juce
{


+ 6
- 2
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -2200,12 +2200,14 @@ private:
static MouseInputSource::InputSourceType getPointerType (WPARAM wParam)
{
#ifdef WM_POINTERWHEEL
#if JUCE_USE_WINDOWS_POINTER_API
POINTER_INPUT_TYPE pointerType;
if (GetPointerType (GET_POINTERID_WPARAM (wParam), &pointerType))
if (pointerType == 3)
return MouseInputSource::InputSourceType::pen;
#else
ignoreUnused (wParam);
#endif
return MouseInputSource::InputSourceType::mouse;
@@ -2348,7 +2350,7 @@ private:
return true;
}
#ifdef WM_POINTERUPDATE
#if JUCE_USE_WINDOWS_POINTER_API
bool handlePointerInput (WPARAM wParam, LPARAM lParam, const bool isDown, const bool isUp)
{
POINTER_INPUT_TYPE pointerType;
@@ -2944,6 +2946,7 @@ private:
return 1;
//==============================================================================
#if JUCE_USE_WINDOWS_POINTER_API
case WM_POINTERUPDATE:
if (handlePointerInput (wParam, lParam, false, false))
return 0;
@@ -2958,6 +2961,7 @@ private:
if (handlePointerInput (wParam, lParam, false, true))
return 0;
break;
#endif
//==============================================================================
case WM_MOUSEMOVE: doMouseMove (getPointFromLParam (lParam), false); return 0;


Loading…
Cancel
Save