Implement Mouse Chording

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.
User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

ChowGuy wrote:Ie, If you have "button chording" assigned, the the initial button (or any action assigned as "default") does not get seen until you release it. Admittedly this mostly affects button1 [drag] button2 [mouse gestures] and maybe button3 for some applications, but for those who have only three-button mice to begin that's a major limitation.

That was pretty much the point of my suggesting a drop time in which to detect a second action or abandon the mapping, much like the existing "Double-Click Speed" option.

On the whole though, it's working well, thanks. :D
About the double-click function, as I can see when you release the button at the first click on a given file, the file gets selected and then after the release at the second click it gets opened, so it looks more like 'sequential clicking' (with the same button) instead of chording, which requires the second button to be pressed before the first one is released. So I guess that your suggestion about the drop time might work for such kind of 'sequential click' feature which in fact is not a bad idea. It probably would be limited to double-/triple- click with the same button (coz maybe a sequence of different buttons would be quite messy) but still it would give some good options and especially to those with 3-button mice. To be honest, at the moment my mouse sometimes eats up my left clicks so very often I end up tripple-clicking to get a decent double-click :lol: and I can tell it's quite easy when you get used to it.

Now about the blocked 'first button pressed' message, I was hoping that there would be a 'Block original mouse input' option so the user can decide for himself whether to block it or not. Obviously when you want to use chording most probably you will have to make some compromise about the initial button (in order to use it for several commands instead of only one) but there are many cases when you might allow the 'first button pressed' message to pass so you wouldn't lose its functionality while you also use it for chording. In fact today I tested the chording in a game which uses 'RMB hold down' for dynamic change of viewpoint and I was amazed that it works just perfectly :). Somehow the game receives the 'RMB held down' message and I am able to change the view and when I press the 2-nd button - the chord is also executed :D. While in SolidWorks when I use the Middle button for chording I am not able to change the view at all. On the other hand the idea about the time delay may succeed if the actual blocking is delayed for say 200 ms and if no 2-nd click in that interval - the 'first button pressed' message is passed through and XMBC doesn't expect 2-nd click any more. (Maybe that was what ChowGuy meant :roll:)

And one more thing, if the second button is released before releasing the first one - the chord is executed and nothing else happens, but if you release the second button after the first one is released - the chord gets executed and then the original action of that second button gets executed too even when 'Block original mouse input' is enabled (which I think should not happen).

Greetings!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

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

Re: Implement Mouse Chording

Post by phil »

OK I have spent a bit more time on this today and I hope I have made it better.

I have added an option in the chord window called "Block / Delay original button action until chord is established" when this is ticked (default), it will behave as it does now (in 2.14 Beta 2). When it is unticked, the action for the primary chord button should run as normal (no blocking), but the chords will still work when another button is pressed.

I'm interested to know how this works for various use-cases.

Ive also modified the code to detect the second chord button being released after the first, and blocking the non-chorded action happening when that button is subsequently released (I hope).

Feedback welcome (essential :)) - I will try and publish the new beta (beta 3) today.

Thanks,
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)

User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

Surprise, surprise :)

Happy to catch up the good news!

I hope tomorrow I would be able to devote a couple of hours to try the new changes and post my findings.

Greetings!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

Finally managed to do some decent tests and post a reply :)
phil wrote:Ive also modified the code to detect the second chord button being released after the first, and blocking the non-chorded action happening when that button is subsequently released (I hope).
I see that now the chord is executed when the second button is 'pressed' which seems to be much faster and more reliable than when 'released'. Indeed the non-chorded action of the second chord button being released after the first is blocked (at least in Windows 8.1 and SolidWorks). However the things are quite different in an online game which I sometimes play with some friends. On the one hand the chording works smoothly and reliably just how it should, but it appears that the game somehow receives the 'first button held down' message even when the "Block / Delay original button action until chord is established" option is enabled. It also receives the 'second button released' message no matter whether it is released before or after releasing the first one. Interesting to me is that it doesn't receive the 'second button pressed' message which actually triggers the chord. Maybe there is a logical reason for that but unfortunately I'm too far away from that matter to figure it out on my own :(. Not that it's so much of a pain and most probably there isn't much that could be done about it but certainly it's worth mentioning :)

Greetings!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

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

Re: Implement Mouse Chording

Post by phil »

As mentioned before, games tend to use direct input which might explain why it sees the button even if XMBC blocks them. XMBC simply hooks into the windows mouse hooks - games can do things differently (some do, some don't).

Also, many games tend to block injected input send using the SendInput API (e.g. simulated keys). I guess they do this mainly to prevent cheats. again, some games do, some don't. The majority of online games seem to implement such blocking though.

The good thing about the new chord option (to not block the chord button) is that it should work better with games than block SendInput which wont have worked with the original release method. But if the game uses direct input anyway, it will act on the first button press regardless of what XMBC then does to the message.

Thanks,
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)

User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

Oh, thanks very much for that detailed explanation :)

Now I begin to understand some things which I've been trying to explain to myself but without any success til now. I've played on several private servers in the past and I've used a couple of clickers that always worked but it turned out that they don't work on the retail server. So that's how I found XMBC :). It was a great surprise to see that all its features are working just perfectly. However a few weeks later they did an upgrade after which the game process was no longer visible in the task manager and XMBC suddenly stopped working (even using the default profile was a no go). I struggled to find out a way to make it work again by the 'Find window' option but no luck there either. Fortunately soon they reverted back the change (due to increased lag and game crashes) so XMBC started working again but I presume that they haven't given up trying and I suspect that I might encounter that problem again. Do you have any clue about that hidden process thing and whether there is a workaround or it would be hopeless if they hide it again?

Thanks!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

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

Re: Implement Mouse Chording

Post by phil »

Ive never heard of hiding even from task manager - I wonder ow they do that!
But if XMBC didn't work even on the default profile, then I suspect they are blocking the API. The only way around that (that I can think of) would be to use a physical (or maybe a virtual device) device attached that pretends to be a keyboard! Not sure if they exist but its far beyond something I could do!
--[ 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
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

I think some viruses and malware can do that, but I never expected it from a game. In fact the process was showing up only for a few seconds when the game client was starting. It's '.bin' and is '32 bit' application if that could be a clue. I've got another app that also works with the game (except at the time when they were hiding the process) and it also requires to chose the game process like XMBC. That app is able to send the commands even when the game is minimized. When I saw the 'Only send if profile's process is active' option in the 'Simulated Keys' window I figured that maybe XMBC can do that too, but it turned out in doesn't. It would be convenient for example when copying some strings from a website and pasting them to word, notepad or some other app for later use while it is minimized. Surely there would be more cases in which such feature could be useful, but lets first see whether it is possible/doable :)

While I was googling to clear out those SendInput and DirectInput terms I stumbled upon some info about 'simulating Keyboard in DirectInput applications by using the SendInput API with Scancodes instead of virtual keys'. But since the picture is a bit fuzzy to me I was wondering if XMBC is already doing this (given that the simulated keys currently work in the game), or if it's doing it with virtual keys would this 'Scancodes' method help if they hide the process again?

Thanks!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

Found something unusual when copying profiles containing 'Button Chording' :?
In the copied profile all (initial) buttons which are assigned to chording are there, but when I open the chording window - all (secondary) buttons are set to 'No Change (Don't intercept)' so I had to manually copy the settings to each one.
BTW I am still with 2.14 Beta 3, but I suspect the problem is in Beta 4 also.

One other thing. In this particular case I wanted to swap 1-st and 2-nd layers (actually I just needed to move/copy the whole 2-nd layer to the 1-st one) in the copied profile, but as I see it's not possible so I copied the settings again :haha:. Probably you have already considered implementing such functionality, so just to mention that both 'copy layer' and 'swap layers' would be useful. Maybe in a context menu right-clicking on the layer title and entering the number of the layer to be swapped with (copied from/to).

Greetings!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

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

Re: Implement Mouse Chording

Post by phil »

lol - yes you are right - I have almost certainly forgotten to add the chords to the copy.
As for copying/swapping layers, a good idea - will look into it.
--[ 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
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

Well I've been thinking what would be better, 'swap layers' or 'move layer left/right', but moving left/right is basically swapping with the adjacent layer, so it seems that 'swap' is the logical choice as it also gives the opportunity to swap nonadjacent layers. And about the 'copy' option, on second thought it would be also useful to be able to copy layers from one profile to another.

Greetings!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

ziongates
New User
Posts: 11
Joined: Sun Jun 12, 2016 3:44 pm

Re: Implement Mouse Chording

Post by ziongates »

Been out of the loop for a while. Testing the button chording and it's BEAUTIFUL! Very responsive.
This app has now been inducted into the Windows Startup Programs Hall of Fame on my PC (that is not easy!).

User avatar
injtsvetkov
Fanatic
Posts: 293
Joined: Mon Jun 06, 2016 8:51 am

Re: Implement Mouse Chording

Post by injtsvetkov »

It's good to have you back mate :)

Button chording is the most significant feature in v2.14 but unfortunately I can't use it on my old XP PC :(. Could you please look at this thread and see if you could think of some crazy idea that I could try and get some clue about what's going on.

Thank you!
Iliya
HAMA Mirano
Windows 8.1 x64, Intel i5-3230M @ 2.60GHz, 4GB

33XAnt
New User
Posts: 8
Joined: Tue Nov 01, 2016 8:48 am

Re: Implement Mouse Chording

Post by 33XAnt »

:?: Just wondering, since mouse-chording has been worked out (marvelously, I might add); does it mean that a chance now exists for handling of multiple clicks (double-clicks to be specific, but I'm sure there are some who would crave more) and duration-definable long holds of a button on a per profile basis?

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

Re: Implement Mouse Chording

Post by phil »

There is a chance - there always is/was a chance - it basically comes down to how much free time I have, and as usual that's rather limited. So I'm not about to make any promises - chording was done in that way - and it was quite a big job but thankfully many of the pitfalls I was worried about have not yet been born out. Right now I'm concentrating on the bugs in the functionality that is already present. Once we have all those bugs ironed out, it will once again be time to expand on this functionality and look at short/long clicks
--[ 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)

Post Reply