Page 1 of 1

Using Two mapped buttons together

Posted: Sat Feb 01, 2020 12:21 pm
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.

Re: Using Two mapped buttons together

Posted: Sun Feb 02, 2020 4:51 pm
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.)

Re: Using Two mapped buttons together

Posted: Thu Feb 20, 2020 11:21 am
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?

Re: Using Two mapped buttons together

Posted: Thu Feb 20, 2020 11:48 am
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!


Re: Using Two mapped buttons together

Posted: Mon Jun 01, 2020 6:08 pm
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}"

Re: Using Two mapped buttons together

Posted: Mon Jun 01, 2020 7:58 pm
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.

Re: Using Two mapped buttons together

Posted: Mon Jun 01, 2020 9:18 pm
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.

Re: Using Two mapped buttons together

Posted: Mon Jun 01, 2020 11:39 pm
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....

Re: Using Two mapped buttons together

Posted: Mon Jun 01, 2020 11:44 pm
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...

Re: Using Two mapped buttons together

Posted: Tue Jun 02, 2020 1:33 am
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}"