-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrawmouse.h
executable file
·65 lines (47 loc) · 2.35 KB
/
rawmouse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//=================================================================
//
// raw_mouse.h - Windows XP implementation of multi-mouse input
//
//=================================================================
#ifndef __RAW_MOUSE_H
#define __RAW_MOUSE_H
#define _WIN32_WINNT 0x501
#define WM_INPUT 0x00FF
#include "stdafx.h"
#include "resource.h"
//#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
//============================================================
// PROTOTYPES
//============================================================
// init raw mouse by creating the array of raw mice (include sysmouse, include rawmouse, include individual mice)
// Number of mice stored in pRawMice array
// NOTE: init_raw_mouse must be called before this can return the actual number of mice
int raw_mouse_count();
BOOL init_raw_mouse(BOOL, BOOL, BOOL);
// Free up the memory allocated for the raw mouse array
void destroy_raw_mouse(void);
// Every time the WM_INPUT message is received, the lparam must be passed to this function to keep a running tally of
// every mouse move to maintain accurate results for get_raw_mouse_x_delta() & get_raw_mouse_y_delta().
BOOL add_to_raw_mouse_x_and_y(HANDLE); // device handle, x val, y val
// Fetch the relative position of the mouse since the last time get_raw_mouse_x_delta() or get_raw_mouse_y_delta
// was called
ULONG get_raw_mouse_x_delta(int);
ULONG get_raw_mouse_y_delta(int);
ULONG get_raw_mouse_z_delta(int);
// pass the mousenumber, button number, returns 0 if the button is up, 1 if the button is down
BOOL is_raw_mouse_button_pressed(int, int);
char *get_raw_mouse_button_name(int, int);
// Used to determine if the HID is using absolute mode or relative mode
// The Act Labs PC USB Light Gun is absolute mode (returns screen coordinates)
// and mice are relative mode (returns delta)
// NOTE: this value isn't updated until the device registers a WM_INPUT message
BOOL is_raw_mouse_absolute(int);
// This indicates if the coordinates are coming from a multi-monitor setup
// NOTE: this value isn't updated until the device registers a WM_INPUT message
BOOL is_raw_mouse_virtual_desktop(int);
//void get_xypos(int*, int*);
// damon test: gives current x and y positions of a mouse device...
#endif /* ifndef __RAW_MOUSE_H */