mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Adding WM_POINTER family to win32_window.h + changing WINVER in win32_platform.h
This commit is contained in:
parent
56ecd62f58
commit
04d5e94eb0
@ -49,13 +49,13 @@
|
||||
#endif
|
||||
|
||||
// GLFW requires Windows XP or later
|
||||
#if WINVER < 0x0501
|
||||
#if WINVER < 0x0604
|
||||
#undef WINVER
|
||||
#define WINVER 0x0501
|
||||
#define WINVER 0x0604
|
||||
#endif
|
||||
#if _WIN32_WINNT < 0x0501
|
||||
#if _WIN32_WINNT < 0x0604
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#define _WIN32_WINNT 0x0604
|
||||
#endif
|
||||
|
||||
// GLFW uses DirectInput8 interfaces
|
||||
@ -104,7 +104,7 @@
|
||||
#define _WIN32_WINNT_WINBLUE 0x0602
|
||||
#endif
|
||||
|
||||
#if WINVER < 0x0601
|
||||
#if WINVER < 0x0400
|
||||
typedef struct tagCHANGEFILTERSTRUCT
|
||||
{
|
||||
DWORD cbSize;
|
||||
@ -116,7 +116,7 @@ typedef struct tagCHANGEFILTERSTRUCT
|
||||
#endif
|
||||
#endif /*Windows 7*/
|
||||
|
||||
#if WINVER < 0x0600
|
||||
#if WINVER > 0x0400 //Changed from 0x0600 to 0x0400
|
||||
#define DWM_BB_ENABLE 0x00000001
|
||||
#define DWM_BB_BLURREGION 0x00000002
|
||||
typedef struct
|
||||
|
@ -31,8 +31,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <WinUser.h>
|
||||
#include <windowsx.h>
|
||||
#include <shellapi.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define _GLFW_KEY_INVALID -2
|
||||
|
||||
@ -561,6 +563,63 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_POINTERDOWN:
|
||||
{
|
||||
POINTER_TOUCH_INFO touchInfo;
|
||||
POINTER_PEN_INFO penInfo;
|
||||
POINTER_INFO pointerInfo;
|
||||
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
|
||||
POINTER_INPUT_TYPE pointerType = PT_POINTER;
|
||||
|
||||
// default to unhandled to enable call to DefWindowProc
|
||||
BOOL fHandled = FALSE;
|
||||
|
||||
// Retrieve common pointer information
|
||||
if (!GetPointerType(pointerId, &pointerType))
|
||||
{
|
||||
// failure, call
|
||||
GetLastError();
|
||||
// set PT_POINTER to fall to default case below
|
||||
pointerType = PT_POINTER;
|
||||
}
|
||||
|
||||
switch (pointerType)
|
||||
{
|
||||
case (PT_PEN):
|
||||
//Retrieve pen information
|
||||
if (!GetPointerPenInfo(pointerId, &penInfo))
|
||||
{
|
||||
// failure, call
|
||||
GetLastError();
|
||||
}
|
||||
else
|
||||
{
|
||||
// success, process penInfo
|
||||
int xPos = GET_X_LPARAM(lParam);
|
||||
int yPos = GET_Y_LPARAM(lParam);
|
||||
if (IS_POINTER_INCONTACT_WPARAM(wParam))
|
||||
{
|
||||
printf("The pen pressure is = %d", penInfo.pressure);
|
||||
}
|
||||
// mark as handled to skip call to DefWindowProc
|
||||
fHandled = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (!GetPointerInfo(pointerId, &pointerInfo))
|
||||
{
|
||||
// failure.
|
||||
GetLastError();
|
||||
}
|
||||
else
|
||||
{
|
||||
// success, proceed with pointerInfo.
|
||||
// fHandled = HandleGenericPointerMessage(&pointerInfo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_CAPTURECHANGED:
|
||||
{
|
||||
// HACK: Disable the cursor once the caption button action has been
|
||||
|
@ -27,7 +27,8 @@
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#include <WinUser.h>
|
||||
#include <windowsx.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
Loading…
Reference in New Issue
Block a user