Page 1 of 1

Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 1:32 am
by Flowgun
XMBC Version: 2.18.8
Windows Version: windows 10 1903
Mouse Information (brand/model): Logitech G502

long-time user (maybe 10 years or so) and I love the software. The subject basically says it all =)

for example, when I'm painting with photoshop, I want mouse button 5 to simulate pressing R and LMB during the mouse click so I can rotate the canvas, and when I release the button, I want to get back to the brush tool by pressing B.

Is this possible? I tried various combinations but I didn't succeed...
If not, please consider adding this functionality

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 9:02 am
by phil
Yes you can (as of version 2.17 I think). Its a bit more complex, but there are three new(ish) tags {OD} {OU} and {OR}.
So if you select the "During action" it will work as follows...
  • Anything prefixed with {OD} will ONLY happen when the button is pressed (down).
  • Anything prefixed with {OU} will ONLY happen when the button is released (up).
  • Anything without a prefix will work as before (pressed on press and released on release)
So this should work fro what you said..
{LMB}r{OU}b

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 10:56 am
by Kukurykus
r{LMB}{OU}b (with method 3 - DURING)

For some reason b is not pressed. What is more weird, when I select any tool (including brush) and then use LMB it is going to correctly select r tool, let for canvas rotation, but when I release LMB it selects back the tool that was selected before canvas rotation :/

btw is there any difference if I start above code from {OD}, and when exactly and what for insert {OR}?

Ps. this is powerful feature I was too lazy to test on 27th Dec 2018 (version 2.18), I will use from now on only you explain how it works, because as you see something fails or I can't figure it out. THX!

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 11:37 am
by phil
OK I'm wrong, the {OD} {OR} and {OU} tags do nothing with DURING.
They probably should... but they don't.
So my answer was simply wrong.

Therefore I don't think its possible right now, with during, to achieve exactly what you want. I will change XMBC so they {OD} {OU} will work with during ({OR} wont ever work with during as thats only for repeating sequences)...

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 12:35 pm
by Kukurykus
Too bad. This feature would be most useful for me with 'during' method, and I'm not sure if only or mainly.

btw I made a post in other theard, then I deleted it and tried to repopst, but it said it needs your approval (probably some anti-spam system activated). You were on forum from then on here, so I'm not sure you missed that or you haven't got it. I tried to post it again, but again I got the same information.

https://forums.highrez.co.uk/viewtopic. ... 651#p20651

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 6:00 pm
by phil
Too bad? You don't want me to change XMBC to make it work?
I will change XMBC so they {OD} {OU} will work with during ({OR} wont ever work with during as thats only for repeating sequences)...
It will be there and working as expected in 2.19 Beta 4!

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 6:57 pm
by Kukurykus
Ah, I'm sorry, you are right again! You meant only {OR} won't ever be working with 'during' method ;)

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Sun Oct 06, 2019 8:20 pm
by Kukurykus
Great job! r{LMB}{OU}b (with method 3 - DURING) works in v2.19 Beta 4!

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Tue Oct 08, 2019 8:14 am
by Flowgun
Thank you Kukurykus for picking up on the issue and thank you Phil for the quick replies and even the quick update for X-mouse! I'm going to try it right now. Thank you a lot =D

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Tue Oct 08, 2019 8:32 am
by Flowgun
I just tried the 2.19 beta 4 (r{LMB}{OU}b) with During (3). It worked more often than not but it was inconsistent. tried adding a wait command after {OU} (r{LMB}{OU}{WAITMS:100}b) but it "b" wasn't pressed.
Maybe wait commands don't work on release after "during"? I hope this helps.

Anyway, I solved the inconsistency problem by adding the wait command just before {LMB}: r{WAITMS:100}{LMB}{OU}b). This worked perfectly. I tried to reduce the waiting time to 10MS but the inconsistency came back. I set it to 50MS (r{WAITMS:50}{LMB}{OU}b) and now it's smooth enough and it works every time =D

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Tue Oct 08, 2019 11:01 am
by phil
Glad your getting there.
The reason that B was not pressed when you did r{LMB}{OU}{WAITMS:100}b is that you applied the ON UP to the wait but did not also apply the ON UP to the 'b', so B would have been send when the button was pressed and cleared when the button was release, which is back to the original problem!. You have to prefix EVERY key AND TAG you want sent when then button is released with {OU}
You should try: r{LMB}{OU}{WAITMS:100}{OU}b

It might also be worth trying {OD}r{LMB}{OU}b - but if the delay is working prior to {LMB} then all is good I guess.

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Tue Oct 08, 2019 4:15 pm
by Kukurykus
Wouldn't it be better to not preced every tag, so if there is {OU} that'd be bound to everything that's after?

Re: Can I press buttons during mouse press and then another key when mouse key is released?

Posted: Wed Oct 09, 2019 6:39 am
by Flowgun
Thank you Phil. Kukurykus stop being annoying xD