mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-30 02:50:05 +00:00
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).
This commit is contained in:
parent
b8d1183f78
commit
f855806602
2 changed files with 14 additions and 2 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue