Selectively remap with multiple mice?

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
Post Reply
pocococo
New User
Posts: 9
Joined: Tue Mar 31, 2009 10:24 pm

Selectively remap with multiple mice?

Post by pocococo »

I have a 4-button Kensington Expert Mouse trackball as well as a Wacom pen tablet connected to my computer. I like X-Mouse Button Control because it lets me remap my Expert Mouse buttons on Vista, where the Kensington driver isn't supported and doesn't work very well for me. However, I don't want X-Mouse to modify the behavior of the buttons on my Wacom pen.

Is there a way by which X-Mouse could discriminate between events coming from different devices, and avoid remapping button events for devices that the user had excluded? I'm thinking maybe of a list with a checkbox for each device or something.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Selectively remap with multiple mice?

Post by phil »

Sorry, no this is not possible.
I have been trying to work out a way of doing this but unfortunately, I have come to the conclusion that it is not feasable from a user level program.

I am still working on it and I may have a breakthrough, but don't count on it - I've tried using direct input and that does tell me where the messages come from but unfortunately, after I receive the mouse messages and not before, which makes it pretty impossible to work with :(.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
AlexV
New User
Posts: 6
Joined: Fri Jul 03, 2009 4:54 pm

Re: Selectively remap with multiple mice?

Post by AlexV »

Have you tried Raw Input? Multiple Mice in Windows XP using Raw Input has a lot of information about this, including example apps and a helper API.

I've just knocked together some quick proof-of-concept code, and it does appear that the Raw Input does occur immediately before the WH_MOUSE mouse hook, as required.

If you do decide to implement multiple mouse detection, can I suggest also allowing per-mouse speed control? For laptop users, the touchpad often requires a very different sensitivity setting to the mouse. Similarly, trackball users may also have a mouse attached, which may need a different sensitivity. There is definitely demand for this, as there is already both a free and a commercial utility to switch between two sensitivities.

They, however, require a hotkey to be pressed to switch sensitivity. If you can detect multiple mice, though, you can do better. Once a mouse is clicked, or moved more than a small tolerance (SM_CX/YDRAG would seem reasonable), it becomes the active mouse and the sensitivity setting set for that mouse is applied. I bet that would bring in a whole new user-base, if they found out about it.

I know you've said that you're now in maintenance mode, and don't intend to add new features to XMBC, but wouldn't this be pretty cool?

Alex
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Selectively remap with multiple mice?

Post by phil »

Ive tried playing around with raw input a while back and although I managed to pickup the input from different devices, in the hook itself, it is still impossible to know which device sent the message. I could not think of an easy way to tie the two systems together, as there is no guarantee about message ordering etc (if you press a button on each device, say hold one down, and release the other, it gets near impossible).

Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
AlexV
New User
Posts: 6
Joined: Fri Jul 03, 2009 4:54 pm

Re: Selectively remap with multiple mice?

Post by AlexV »

Yes, I see what you're saying. You can't be 100% guaranteed sure where a hooked message came from.

To be honest, though, 99% is almost certainly good enough. How likely is it that a user will hold down a button on both devices at the same time anyway? If you just have it so that moving a device, or clicking any button on it (detected in raw), makes it the 'active' device, then settings assigned to it can be used in the hook.

Thanks for considering it, anyway.

Alex
AlexV
New User
Posts: 6
Joined: Fri Jul 03, 2009 4:54 pm

Re: Selectively remap with multiple mice?

Post by AlexV »

Just done a bit more checking. Although the Raw Input comes before the WH_MOUSE hook, it comes after the WH_MOUSE_LL hook, which presumably is the one you are using. I guess that means this won't work after all.

How very irritating.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Selectively remap with multiple mice?

Post by phil »

Yes that sounds familiar... my hook was getting called before the raw input. And I have to use the low level hook for various reasons, not least that I had major problems with the normal hook on some OS's.

As I said, I spent some time looking into this and did not come up with any magical ideas... But I havnt totally given up - I just dont have a lot of time to spare for XMBC and things like that certainly take time :(
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply