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

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
Flowgun
New User
Posts: 4
Joined: Sun Oct 06, 2019 1:07 am

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

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

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

Post 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
--[ 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
Kukurykus
Fanatic
Posts: 394
Joined: Sat Jul 02, 2016 1:15 pm

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

Post 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!
HAMA Roma, Rapoo 3920P
Windows 10 x64, Intel i5-4670K @ 3.40GHz, 8GB,
Intel(R) HD Graphics 4600, Intel SSD 179 GB HDD
User avatar
phil
Site Admin
Posts: 7661
Joined: Sun Apr 06, 2003 11:12 pm

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

Post 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)...
--[ 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
Kukurykus
Fanatic
Posts: 394
Joined: Sat Jul 02, 2016 1:15 pm

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

Post 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
HAMA Roma, Rapoo 3920P
Windows 10 x64, Intel i5-4670K @ 3.40GHz, 8GB,
Intel(R) HD Graphics 4600, Intel SSD 179 GB HDD
User avatar
phil
Site Admin
Posts: 7661
Joined: Sun Apr 06, 2003 11:12 pm

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

Post 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!
--[ 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
Kukurykus
Fanatic
Posts: 394
Joined: Sat Jul 02, 2016 1:15 pm

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

Post by Kukurykus »

Ah, I'm sorry, you are right again! You meant only {OR} won't ever be working with 'during' method ;)
HAMA Roma, Rapoo 3920P
Windows 10 x64, Intel i5-4670K @ 3.40GHz, 8GB,
Intel(R) HD Graphics 4600, Intel SSD 179 GB HDD
User avatar
Kukurykus
Fanatic
Posts: 394
Joined: Sat Jul 02, 2016 1:15 pm

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

Post by Kukurykus »

Great job! r{LMB}{OU}b (with method 3 - DURING) works in v2.19 Beta 4!
HAMA Roma, Rapoo 3920P
Windows 10 x64, Intel i5-4670K @ 3.40GHz, 8GB,
Intel(R) HD Graphics 4600, Intel SSD 179 GB HDD
Flowgun
New User
Posts: 4
Joined: Sun Oct 06, 2019 1:07 am

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

Post 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
Flowgun
New User
Posts: 4
Joined: Sun Oct 06, 2019 1:07 am

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

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

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

Post 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.
--[ 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
Kukurykus
Fanatic
Posts: 394
Joined: Sat Jul 02, 2016 1:15 pm

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

Post 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?
HAMA Roma, Rapoo 3920P
Windows 10 x64, Intel i5-4670K @ 3.40GHz, 8GB,
Intel(R) HD Graphics 4600, Intel SSD 179 GB HDD
Flowgun
New User
Posts: 4
Joined: Sun Oct 06, 2019 1:07 am

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

Post by Flowgun »

Thank you Phil. Kukurykus stop being annoying xD
Post Reply