[Bf-blender-cvs] [b87c5b554e5] temp-rawdata: Probar raw data
Antonio Vazquez
noreply at git.blender.org
Thu Nov 7 11:28:25 CET 2019
Commit: b87c5b554e55e0805ec88a88c96966035f96f363
Author: Antonio Vazquez
Date: Sun Oct 13 19:01:14 2019 +0200
Branches: temp-rawdata
https://developer.blender.org/rBb87c5b554e55e0805ec88a88c96966035f96f363
Probar raw data
===================================================================
M intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index c86accf4ede..f6e5ca13d2b 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -141,9 +141,9 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
static void initRawInput()
{
#ifdef WITH_INPUT_NDOF
-# define DEVICE_COUNT 2
+# define DEVICE_COUNT 3
#else
-# define DEVICE_COUNT 1
+# define DEVICE_COUNT 2
#endif
RAWINPUTDEVICE devices[DEVICE_COUNT];
@@ -153,11 +153,13 @@ static void initRawInput()
// That way GHOST can retrieve true keys
devices[0].usUsagePage = 0x01;
devices[0].usUsage = 0x06; /* http://msdn.microsoft.com/en-us/windows/hardware/gg487473.aspx */
+ devices[1].usUsagePage = 0x01;
+ devices[1].usUsage = 0x02; // mouse
#ifdef WITH_INPUT_NDOF
// multi-axis mouse (SpaceNavigator, etc.)
- devices[1].usUsagePage = 0x01;
- devices[1].usUsage = 0x08;
+ devices[2].usUsagePage = 0x01;
+ devices[2].usUsage = 0x08;
#endif
if (RegisterRawInputDevices(devices, DEVICE_COUNT, sizeof(RAWINPUTDEVICE)))
@@ -960,6 +962,22 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type,
}
}
else {
+ static int lastStamp = 0;
+ MOUSEMOVEPOINT mp_in = {x_screen, y_screen, GetMessageTime()};
+ MOUSEMOVEPOINT mp_out[64];
+ int cpt = GetMouseMovePointsEx(sizeof(mp_in), &mp_in, mp_out, 64, GMMP_USE_DISPLAY_POINTS);
+ if (cpt > 0) {
+ int i = cpt - 1;
+ while (i >= 0) {
+ if (mp_out[i].time > lastStamp) {
+ auto evt = new GHOST_EventCursor(
+ system->getMilliSeconds(), GHOST_kEventCursorMove, window, mp_out[i].x, mp_out[i].y);
+ system->pushEvent(evt);
+ }
+ i--;
+ }
+ lastStamp = mp_out[0].time;
+ }
return new GHOST_EventCursor(
system->getMilliSeconds(), GHOST_kEventCursorMove, window, x_screen, y_screen);
}
@@ -1216,6 +1234,23 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
GHOST_PRINT(" key ignored\n");
}
break;
+ case RIM_TYPEMOUSE:
+ char szTempOutput[512];
+ sprintf(
+ szTempOutput,
+ TEXT("Mouse: usFlags=%04x ulButtons=%04x usButtonFlags=%04x usButtonData=%04x "
+ "ulRawButtons=%04x lLastX=%04x lLastY=%04x ulExtraInformation=%04x\r\n"),
+ raw.data.mouse.usFlags,
+ raw.data.mouse.ulButtons,
+ raw.data.mouse.usButtonFlags,
+ raw.data.mouse.usButtonData,
+ raw.data.mouse.ulRawButtons,
+ raw.data.mouse.lLastX,
+ raw.data.mouse.lLastY,
+ raw.data.mouse.ulExtraInformation);
+
+ OutputDebugString(szTempOutput);
+ break;
#ifdef WITH_INPUT_NDOF
case RIM_TYPEHID:
if (system->processNDOF(raw)) {
More information about the Bf-blender-cvs
mailing list