Ok, I found a app that uses Win32 to get raw input.
raw_mouse.h:
//=================================================================
//
// raw_mouse.h - Windows XP implementation of multi-mouse input
//
//=================================================================
#ifndef __RAW_MOUSE_H
#define __RAW_MOUSE_H
#include <windows.h>
#include <stdio.h>
//============================================================
// PROTOTYPES
//============================================================
// init raw mouse by creating the array of raw mice (include sysmouse, include rawmouse, include individual mice)
BOOL init_raw_mouse(BOOL, BOOL, BOOL);
// 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();
// 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);
#endif /* ifndef __RAW_MOUSE_H */
//=================================================================
//
// raw_mouse.h - Windows XP implementation of multi-mouse input
//
//=================================================================
#ifndef __RAW_MOUSE_H
#define __RAW_MOUSE_H
#include <windows.h>
#include <stdio.h>
//============================================================
// PROTOTYPES
//============================================================
// init raw mouse by creating the array of raw mice (include sysmouse, include rawmouse, include individual mice)
BOOL init_raw_mouse(BOOL, BOOL, BOOL);
// 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();
// 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);
#endif /* ifndef __RAW_MOUSE_H */
To copy to clipboard, switch view to plain text mode
So I include the C file:
extern "C"{
#include "raw_mouse.h"
}
extern "C"{
#include "raw_mouse.h"
}
To copy to clipboard, switch view to plain text mode
And call the initialization function, then check for amount of raw mouse inputs:
init_raw_mouse(1,0,1);
qDebug() << raw_mouse_count();
init_raw_mouse(1,0,1);
qDebug() << raw_mouse_count();
To copy to clipboard, switch view to plain text mode
But that outputs 0. When it should show 5.That's what the original Win32 app displays.
Bookmarks