Volume keys TO NORMAL mouse keys

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 or images until they have at least 4 posts.
Post Reply
ADhAEhAFh
New User
Posts: 3
Joined: Sat Aug 01, 2020 11:42 am

Volume keys TO NORMAL mouse keys

Post by ADhAEhAFh »

XMBC Version: 2.19.2
Windows Version: 7 SP1 32-bit / Vista SP2 32-bit
Mouse Information (brand/model): SteelSeries Sensei 310
Relevant Computer Information (CPU, RAM etc): i3-2120; 4Gb / Centrino Duo T8100; 4Gb / AMD E1 [1.0 GHz (!!!)]; 2Gb
Did the problem occur after an upgrade of XMBC? (If so, from what version?): never
Did the problem occur after a Windows update/upgrade? (If so, from what version?): never
How long have you used XMBC?: never
What language and keyboard layout do you use in Windows?: doesn't matter

Remap 0xAD, 0xAE and 0xAF (APPCOMMAND_VOLUME_*keys*) _TO_ 0xC3, 0xC4, 0xC5 (Unreal Tournament 2 Mouse6, Mouse7 and Mouse8):

Code: Select all

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,04,00,00,00,??,??,20,e0,??,??,2e,e0,  ??,??,30,e0,00,00,00,00
It only affects the PS/2 (notebook) KEYBOARD, not external/wireless or a mouse!
If you know, how to do it without a program, I would glad to remap all of it and will never use this program at all, as before.

Yes, I don't want to handle the volume — I want to remove this feature from the Windows at all, because these volume keys can not be reassigned in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\ *8*, *9* and *10* subkeys!

P.S. Sensei 310 have 8 buttons, and can assign its buttons to Button6, Button7 and Button8, but UT doesn't response them. I already wrote the feedback to SteelSeries, but they…
cannot promise it will be implemented.

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

Re: Volume keys TO NORMAL mouse keys

Post by phil »

XMBC can map mouse buttons to keys, but not the other way round.
Have you looked at AutoHotkey - maybe you can script this in there? Try their forums for help?
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

ADhAEhAFh
New User
Posts: 3
Joined: Sat Aug 01, 2020 11:42 am

Re: Volume keys TO NORMAL mouse keys

Post by ADhAEhAFh »

I just looking for a way to remap the commands that these mice transmit.
I had 'noname' china-mouse, that already assigned the volume keys (that I wanted to remap too), but it has another problem: sometimes it sends 'button PRESS' when I drag then release it! i.e.:
button PRESS;
mouse moving;
button PRESS (!!!);
button RELEASE

total: TWO presses, ONE release! Result: The knob/slider that I adjusted is still HEAR the mouse position!
Click this button again and again – the knob/slider still rotating/moving.
I tried to unpress the stuck knob/slider with AHK — it FAILED! Or it cannot transmit the mouse commands to the program I need! I mean, I need a program that modifies the "events" on the fly so that another program identifies these messages as coming from the same mouse (not an other source)!
No, I'll never use autohotkey anymore and never recommend it anybody!
ADhAEhAFh wrote:
Sat Aug 01, 2020 12:18 pm
have 8 buttons, and can assign its buttons to Button6, Button7 and Button8
Oh, I forgot to mention (why I never use XMBC): remap simple Mouse4 and Mouse5 to different actions (or as real but different mouse buttons), apply and run UT2k4… Unreal Tournament still catches them as MOUSE4 and MOUSE5 — nothing changed!
___
P.S. The Sensei 310 sometimes (after system boot-up) has these issues:
[1] click-drag performs click-click-click-click-click… (infinity times, until release or stop dragging);
[2] The mouse cursor sticks to the bottom (e.g. in taskbar). X Axis works good, but I can't move it by Y Axis! Push the device from myself very hard — the cursor appears at a moment and immidiately sticks to the bottom;
I must re-plug the mouse to solve each of that problem.

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

Re: Volume keys TO NORMAL mouse keys

Post by phil »

Sounds like a faulty mouse to me - I don't understand how it could send multiple presses without corresponding releases. If it were a dirty button/switch contact, I would expect it s send lots of press/release/press/release combos but never press, press, press, press.... release

That is really going to screw with Windows (never mind AHK or XMBC) - which I guess is what you are seeing.
Rather than send an additional release (with AHK) you'd be better off blocking the second press - as in swallowing the message and not forward it on. That may be possible.

Unreal tournament probably uses direct input or raw input - this is much lower level and can not be blocked by XMBC. XMBC (and AHK) intercept Windows Mouse Hook messages and that's the only place you can "block" messages. If a game operates at a lower level (as many do), your screwed on that front.

AHK and XMBC are both limited by what you can do in Windows without writing your own mouse driver. The only way (that I am aware of) you could block these messages from everything (including raw/direct input) would be to write a mouse filter driver. This is technically difficult AND expensive as you need to digitally sign your driver and to do that you need to be a registered company and spend 100's of dollars a year to do so. Fine for a device manufacturer, not so fine for the hobby programmer!

So I fear you may be out of luck with this one.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

ADhAEhAFh
New User
Posts: 3
Joined: Sat Aug 01, 2020 11:42 am

(about sending Press when already pressed)

Post by ADhAEhAFh »

phil wrote:
Thu Aug 06, 2020 12:17 pm
how it could send multiple presses without corresponding releases.
I think it is generated by chip (mouse internal firmware bug: maybe the chip "forgets" about the already pressed button and sends the second "press" BEFORE the "release", maybe), not by physical buttons.
phil wrote:
Thu Aug 06, 2020 12:17 pm
better off blocking the second press - as in swallowing the message and not forward it on. That may be possible.
And I would like to know, how to do this. I performed many searches for a program/driver, but got "doubleclick-blockers" only :cry: ;(the "unpress" comes many seconds later!), and yes I need a program like this:

Code: Select all

"if" no one mouse key is pressed/released at the program start ? hearing…
if catch the first "Button_1" 'press' ?
 start to 'swallowing' the 'press' of "Button_1" & hearing…
 catch the 'release' ? return;
if catch the first "Button_2" "press" ?
 start to 'swallowing' the 'press' of "Button_2" & hearing…
 catch the 'release' ? return;
if catch the 'release' of "Button_2" ?
 run a timer with "adjusted_for_button_2" & hearing…
 filter the "Button_2" 'press' & '_optionally_Release';
 timer is over ? return;
if catch the 'release' of "Button_1" ?
 run a timer with "adjusted_for_button_1" & hearing…
 filter the "Button_1" 'press' & '_optionally_Release';
 timer is over ? return;
…
I don't know how to «transcode» this logic to ASM/pas/basiC+ (don't even look at the .NET!!), and it is a pity that it can not work fine in X-MBC :\

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

Re: Volume keys TO NORMAL mouse keys

Post by phil »

XMBC uses mouse hooks. You could in theory write a hook function that performs the logic you mention, however there are several limitations with mouse hooks. XMBC is a tool to remap buttons, its not really designed to fix bad mice. The current de-bounce stuff was an attempt to help reduce the problems associated with noisy contacts on old mouse buttons, but it does not really work very well. And I don't really want to go down that route if I can help it - I don't have enough time to spend on XMBC as it is, let alone trying to fix a problem that a single user is having with a single device.

In your mouse hook, you can swallow/block the message or pass it on (dont block it). XMBC uses this to block reconfigured buttons and do something else instead.

The biggest limitation is that if anything uses directinput/rawinput to capture the mouse, then that operates at a lower level and you cant intercept/block that. This normally impacts games as they tend to be the things using direct input to reduce input latency etc.

You can write mouch hook procedures in C++ (as XMBC does), and I imagine most other languages (certainly .net - but it wont be particularly efficient as it will have to interop lots), ASM Im not familar with these days, pascal - not sure - delphi yes for sure. Look at the MS API SetLowLevelHook for information on how to install a hook procedure to filter the messages.

Ideally though you would do this in a mouse filter driver. But filter drivers are a much more complicated beast - and require signing with certificates not available to the general public (you need to be a registered company and have plenty of $$$ to spend on certificates each year!).
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9, Logitech MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, Intel i5-9600k, Asus Z390-ROG, 16GB DDR4,
nVidia GeForce GTX 970, Evo 970 500Gb NVME, 2x2TB WD Black (RAID1)

Post Reply