Libpointing
An open-source cross-platform library to get raw events from pointing devices and master transfer functions.
winPointingDeviceManager.h
1 /* -*- mode: c++ -*-
2  *
3  * pointing/input/windows/winPointingDeviceManager.h --
4  *
5  * Initial software
6  * Authors: Izzatbek Mukhanov
7  * Copyright © Inria
8  *
9  * http://libpointing.org/
10  *
11  * This software may be used and distributed according to the terms of
12  * the GNU General Public License version 2 or any later version.
13  *
14  */
15 
16 #ifndef WINPOINTINGDEVICEMANAGER_H
17 #define WINPOINTINGDEVICEMANAGER_H
18 
19 #include <pointing/input/PointingDeviceManager.h>
20 #include <windows.h>
21 #include <pointing/input/windows/winPointingDevice.h>
22 #include <vector>
23 
24 namespace pointing
25 {
27  {
28  friend class PointingDeviceManager;
29  friend class winPointingDevice;
30 
31  typedef enum
32  {
33  THREAD_UNDEFINED=0,
34  THREAD_RUNNING,
35  THREAD_TERMINATING,
36  THREAD_HALTED
37  } ThreadState;
38 
39  ThreadState run = THREAD_UNDEFINED; // for the Loop thread
40  HANDLE hThreads[1];
41  DWORD dwThreadId;
42  static DWORD WINAPI Loop(LPVOID lpvThreadParam);
43  void processMessage(MSG *msg);
44  HWND msghwnd_;
45 
46  static LONG APIENTRY rawInputProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
47  HWND rawInputInit();
48 
49  bool fillDescriptorInfo(HANDLE h, PointingDeviceDescriptor &desc);
50 
51  // True if the mouse has moved
52  bool relativeDisplacement(const PRAWMOUSE pmouse, winPointingDevice *dev, int *dx, int *dy);
53 
54  void processMatching(PointingDeviceData *, SystemPointingDevice *);
55 
58  };
59 }
60 
61 #endif // WINPOINTINGDEVICEMANAGER_H
The PointingDeviceManager class is a helper class which enumerates the list of existing pointing devi...
Definition: PointingDeviceManager.h:86
Definition: winPointingDevice.h:18
Definition: PointingDeviceManager.h:96
Definition: DummyPointingDevice.cpp:23
The SystemPointingDevice class is used to represent Pointing Devices connected to the computer...
Definition: SystemPointingDevice.h:28
Definition: PointingDeviceManager.h:42
Definition: winPointingDeviceManager.h:26