Using Two mapped buttons together

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
RaexD
New User
Posts: 3
Joined: Sat Feb 01, 2020 12:04 pm

Using Two mapped buttons together

Post by RaexD »

XMBC Version: 2.18.8
Windows Version: 10 x64 1909
Clear description of the problem - try and include as much information as possible, including what button and mappings you are having problems with (if applicable).: Simply trying to use two simulated sticky held buttons together. M4 is set to sticky held RALT and M5 to sticky held RCTRL in simulated keys. They individually work fine for what I am intending to do. But when I try to use them together since a hotkey is set as RCTRL+RALT+LMB it acts slightly weird. The order of RCTRL or RALT doesn't matter in the hotkey activation.

When I press M4 and the M5 my initial expectation is for them to be activated and held down together. This doesn't happen though. Whichever first key I use M4 or M5 and then the other, only the action of the first key is held down and not the second. I have to press the second key again to get the effect I want. And then, when I have to disable it, I have to press them in reverse order and in reverse number. So M4+M5+M5 gives me the effect of RCTRL+RALT and using M5+M4+M4 releases it from sticky. Any other combo keeps them pressed still.

Also, I am unable to get them to release when the actual RCTRL and RALT are pressed. Since the RALT pressed keeps ALT-TAB window active since it is being held in sticky mode.

EDIT: I solved the last issue at least, getting them to release on button press. But I also want it to not send any query to the system. Basically, have it release on button press and prevent the combined output from the windows. Right now, when CTRL is held down pressing escape opens start menu and releases Ctrl button.

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

Re: Using Two mapped buttons together

Post by phil »

I'm afraid XMBC can currently only handle one sticky button at a time. This is an unfortunate limitation of how it was originally developed, where internally it uses a global state "sticky" flag - just one flag for all buttons. So its doing what its supposed to be doing (how it was designed to work - even if that design was somewhat flawed in this respect). Unfortunately to change this is not an insignificant amount of work (basically the whole lot would have the be thrown away and re-done - and that's not something I can commit to right now.)
--[ 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)

RaexD
New User
Posts: 3
Joined: Sat Feb 01, 2020 12:04 pm

Re: Using Two mapped buttons together

Post by RaexD »

That really sucks. I need it to use in blended, and shortcuts are easier to perform. Some shortcuts require pressing of 2 buttons and well, keep them pressed since they only work while keeping them pressed.
For one, I couldn't even get it to work while actually pressing the button. It did nothing. (This is, for ex. using mouse button 4 + middle mouse button, while mouse button 4 was on the during mode) It just pressed the button and released it. Not sure if it was the mouse hardware doing that or xmbc. That's how I came to use the sticky one. And that worked out better. I didn't even need to keep the button pressed. It would be so much cool if you could use your mouse buttons and multiple (2 or even 3) buttons in sticky mode. This could come in handy for artists, who doesn't have tablets to work upon simultaneously.

I looked around for an alternative to XMBC but none came closer to how efficient and detailed XMBC really is. Hydra was deprecated, and it didn't even work with my mice. I don't think you'd know of any alternative I could use in the meanwhile.

And if not now, but maybe later, could this be a planned feature for XMBC someday?

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

Re: Using Two mapped buttons together

Post by phil »

Sorry, I don't know of any alternatives - autohotkey may be able to do it but you will be having to script it yourself I suspect.

As I said, its a massive rewrite to be able to do this - and while it would be nice, there is a long list of other things I need to do/add to XMBC that some people have been waiting years for, so its not something that's going to happen quickly. XMBC is a hobby project and I simply don't have the time to spend on it as I work full time and have other commitments in life. I cant make any promises but I will add the request to the list!

Regards,
Phil
--[ 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)

AZNsupermarket
New User
Posts: 3
Joined: Mon Jun 01, 2020 5:40 pm

Re: Using Two mapped buttons together

Post by AZNsupermarket »

I just want to join this other users request for the ability to have two mapped buttons together.

I was using auto hotkey, to simulate a middle click when I simultaneously left clicked and right clicked on my trackpad. It used to work perfectly, but all of a sudden, google chrome stopped responding to my simulated middle clicking when I would try to middle click on a tab to close it. Middle clicking normally on a mouse with a scroll wheel still closes the tab just fine though. My simulated middle clicking seems to work for everything other than that. I was hoping that your app could fix my problem, but I guess it doesn't have that functionality.

Anyways, here is the auto-hotkey code I use, in case anyone was interested:

Code: Select all

lbutton::send % getkeystate("rbutton") ? "{mbutton down}" : "{lbutton down}"
lbutton up::send % getkeystate("lbutton") ? "{lbutton up}" : "{mbutton up}"
 
rbutton::send % getkeystate("lbutton") ? "{mbutton down}" : "{rbutton down}"
rbutton up::send % getkeystate("rbutton") ? "{rbutton up}" : "{mbutton up}"

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

Re: Using Two mapped buttons together

Post by phil »

Button chording should do that - you would have to setup both left and right buttons to chord though - and if AHK isn't working, there is a fair chance XMBC will suffer the same - because XMBC and AHK use the same underlaying API to send things as far as I know.
--[ 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)

AZNsupermarket
New User
Posts: 3
Joined: Mon Jun 01, 2020 5:40 pm

Re: Using Two mapped buttons together

Post by AZNsupermarket »

Interestingly, your app by displaying which keys are being pressed, showed me what the issue is. With my code, the left or right button (whichever is pressed first) is still being held down the entire time I'm simulating a middle button click. That's why chrome isn't letting me close tabs.

I figured out the problem, now I just need to figure out the solution.

I'm not clear on how to setup button chording FYI. Not sure if that matters anymore.

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

Re: Using Two mapped buttons together

Post by phil »

OK thats makes sense - for what its worth, button chording blocks the source button UNTIL it knows if your chording or not - so it *should* avoid that problem, at the slight expense of potential few ms lag (which I why personally I avoid chording on the left button).

But if you want to try it - to set it up in XMBC, select button chording for the button in question (left and right)...
Then in the chording setup window that should popup, for the opposite button (reg. Right button button for the left button chord setup) choose middle click. Turn on all the options at the bottom.

e.g. On the left tbutton....
chord.png
You do not have the required permissions to view the files attached to this post.
--[ 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)

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

Re: Using Two mapped buttons together

Post by phil »

PS-> the OP was talking about having multiple "sticky" buttons together which is completely different :). Where a button action is held down (sticky) on first click, and released on second click. He wanted to have different sticky actions on each button, but at the moment in XMBC you can only run one sticky command at a time...
--[ 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)

AZNsupermarket
New User
Posts: 3
Joined: Mon Jun 01, 2020 5:40 pm

Re: Using Two mapped buttons together

Post by AZNsupermarket »

figured it out! Works perfectly now!

Code: Select all

lbutton::send % getkeystate("rbutton") ? "{blind}{rbutton up}{mbutton down}" : "{blind}{lbutton down}"
lbutton up::send % getkeystate("lbutton") ? "{blind}{lbutton up}" : "{blind}{mbutton up}"
 
rbutton::send % getkeystate("lbutton") ? "{blind}{lbutton up}{mbutton down}" : "{blind}{rbutton down}"
rbutton up::send % getkeystate("rbutton") ? "{blind}{rbutton up}" : "{blind}{mbutton up}"

Post Reply