Simultaneously held down keyboard key and mouse button?

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
Clefaria
New User
Posts: 4
Joined: Sat Aug 06, 2011 4:33 am

Simultaneously held down keyboard key and mouse button?

Post by Clefaria »

Basically, I want my right mouse button to act just like it does, except also holding down the Z key in addition to "RMB". Can this be done?
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simultaneously held down keyboard key and mouse button?

Post by phil »

You could try "Simulated keys", "During" mode and use {RMB}z in the keys.
I'm not sure if it would have the desired effect but its most likely option, so give it a try :)
--[ 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)
Clefaria
New User
Posts: 4
Joined: Sat Aug 06, 2011 4:33 am

Re: Simultaneously held down keyboard key and mouse button?

Post by Clefaria »

phil wrote:You could try "Simulated keys", "During" mode and use {RMB}z in the keys.
I'm not sure if it would have the desired effect but its most likely option, so give it a try :)
That's exactly the first thing I tried. It doesn't seem to work.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simultaneously held down keyboard key and mouse button?

Post by phil »

What exactly are you trying to achieve?
Do you want Z to be pressed before or after the mouse button is "held" and likewise, release before or after the button is released?

Its not the easiest one to test without usage scenarios. Have you tried enabling debug logging to see if XMBC is doing things in the order you expect? Is it a game your trying to control in this way - some games don't like mouse/key injection?

And if you could provide basic details such as version of XMBC etc. as listed in the posting rules, it might help.

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)
Clefaria
New User
Posts: 4
Joined: Sat Aug 06, 2011 4:33 am

Re: Simultaneously held down keyboard key and mouse button?

Post by Clefaria »

phil wrote:What exactly are you trying to achieve?
Do you want Z to be pressed before or after the mouse button is "held" and likewise, release before or after the button is released?

Its not the easiest one to test without usage scenarios. Have you tried enabling debug logging to see if XMBC is doing things in the order you expect? Is it a game your trying to control in this way - some games don't like mouse/key injection?

And if you could provide basic details such as version of XMBC etc. as listed in the posting rules, it might help.

Thanks,
Phil
I wanted both the right mouse button and the Z key to be held down (starting at the same time, or if not possible, the Z immediately after the RMB) for as long as I hold down the physical right mouse button, simple as that.

I'm using version 2.0.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simultaneously held down keyboard key and mouse button?

Post by phil »

OK thanks,

Have you checked the debug log as I requested. It should indicate what is going on when you press the button that has the sim-keys mapped to it, and how those sim-keys are being ordered.

If you could send me a snippet, around where you press the button, that might be useful in tracking down what is or is not going on.

In the meantime, I will try those same sim-keys here and see if it works for me (although I'm still not sure how to test such a sequence effectively).

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)
Clefaria
New User
Posts: 4
Joined: Sat Aug 06, 2011 4:33 am

Re: Simultaneously held down keyboard key and mouse button?

Post by Clefaria »

phil wrote:OK thanks,

Have you checked the debug log as I requested. It should indicate what is going on when you press the button that has the sim-keys mapped to it, and how those sim-keys are being ordered.

If you could send me a snippet, around where you press the button, that might be useful in tracking down what is or is not going on.

In the meantime, I will try those same sim-keys here and see if it works for me (although I'm still not sure how to test such a sequence effectively).

Thanks,
Phil
Turns out the game I wanted to do this in allows me to simply map both actions to the right mouse button, so it won't be necessary. I'll revisit the topic if it comes up again.

The test that I did, though, was to simply map the right mouse button to press Z (forget the simultaneous right-click for now) with the 'during' setting in Notepad, and notice that it only presses Z once, where if I actually held the key down, I'd get a string of Zs until I let go.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simultaneously held down keyboard key and mouse button?

Post by phil »

OK I will check, but I think the key repeat thing is done at a different level, because it works fine for function keys like CTRL/ALT etc, but alphanumeric keys have the repeat done by the OS and I guess the sendinput methods don't get injected in the right place to trigger this repeat. This is why you have the repeat options in sim keys (although this would not work for your scenario as it would repeat the mouse button too :( ).

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)
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simultaneously held down keyboard key and mouse button?

Post by phil »

OK Ive been digging in the code and I think I have figured out what was going on and why it was not working.
I think I have fixed it in v2.1 beta 10 if you want to give it a try your welcome, if not I will push on in hope :)

NOTE: The key will still not be repeated in notepad, because the windows auto-repeat functionality is not effected by injected keystrokes (as I mentioned yesterday), however, I have tested this in a few games where holding the key performs the action (in one case I set Z to strafe left and holding the button kept moving left, thus I can conclude the key is now being kept pressed until the button is released.). So I think all is good now.

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)
Post Reply