winapi - raw input handling (distinguishing secondary mouse) -
i writing pices in winapi's raw input seem working though not sure how reliable (unfaliable) (and if working on systems machines etc, bit worry)
also there appears many question, 1
i use first (i mean normal/base mouse) in old way, processint wm_mousemove etc , moving arrow cursor, secondary mouse need processing raw_input (primary can stay untouched rawinput), problem is
1) how can sure mouse detected rawinput secondary?
2) second mouse moves arrow -cursor, if disable ridev_nolegacy both not moving cursor (it bacame hourglass) , wrong too
think maybe should setup bit differently setrup rawinput function like
void setuprawinput() { static rawinputdevice rid[1]; rid[0].ususagepage = 0x01; rid[0].ususage = 0x02; rid[0].dwflags = 0; // rid[0].dwflags = ridev_nolegacy; / rid[0].hwndtarget = null; int r = registerrawinputdevices( rid, 1, sizeof(rid[0]) ); if (!r) error_exit("raw input register fail"); }
how resolve issueas andmake work? tnx
i don't know if approach best one, or not, how first item in question:
when process wm_input using getrawinputdata(...), check see if device handle passed rawinputheader structure (contained within rawinput structure returned function) same device want use. if not, don't bother sending data, if is, process rawinputmouse data returned in rawinput struct.
and if you're wondering how list of devices, can use getrawinputdevicelist(...), return device handles of mice you're trying work with.
as said, may not best way, have confirmed work purposes. keyboard raw input data well.
as item #2, seems affects both mice because windows has exclusive access mice, can't register 1 specific mouse without registering them same flags. more knowledge give better explanation.
Comments
Post a Comment