trying to add chording, but not getting expected result

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
User avatar
Astara
Member
Posts: 21
Joined: Wed Jul 27, 2011 6:30 am

trying to add chording, but not getting expected result

Post by Astara »

2.28.8 Version:
7SP1 Version:
Kensington Expert mouse):

years/b]:
english:
I'm trying chording for the first time and am not getting the results I want.

note 'r'=right mouse button on kb, and 't'=left mouse button.

I had a sequence of keys on my lft button:
T{WAITMS:8}4{WAITMS:1}R{WAITMS:3}
repeat while button is down, autorepeat delay 2ms
only send if profilprocess active

Added chording so if I pressed left, held+right, the right should add:
e{waitms:3}e

On rt button have:
R{WAITMS:8}T{WAITMS:8}4{WAITMS:1}
2ms auto repeat

Added chording of Rt on top of Lft and LFt on top of Rt:
So i press + hold left, then press rt, it should issue:
q{waitms:3}q (press-on-down, release on up)

the e and q are supposed to dart right and left, but I'm not seeing any sign of this.

What did I do wrong?

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

Re: trying to add chording, but not getting expected result

Post by phil »

Is this in a game?
Many games don't work with simulated input... Does it work in notepad?

Your text is very difficult to follow... Perhaps because of all the shortened text - this is not an SMS message - try and be as clear as possible usn ful wds plz otw hw t fk am I supsd 2 undstd?.

When you say
note 'r'=right mouse button on kb, and 't'=left mouse button.
What do you mean? do you mean r = {rmb} - or you are just sending the 'r' key?

Oh and there is no v2.28.8 - presume you meant v2.18.8?
--[ 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
Astara
Member
Posts: 21
Joined: Wed Jul 27, 2011 6:30 am

Re: trying to add chording, but not getting expected result

Post by Astara »

phil wrote: Sat May 16, 2020 4:37 pm Is this in a game?
Many games don't work with simulated input... Does it work in notepad?
Yes, it is in a game, "bladeandsoul.com". It was working up until I tried adding chording.

Your text is very difficult to follow... Perhaps because of all the shortened text - this is not an SMS message - try and be as clear as possible usn ful wds plz otw hw t fk am I supsd 2 undstd?.
Believe it or not, I don't have a cell phone, I picked up habits from chatting in the game, but due to having RSI (Repetitive Strain Injuries) from over typing, I sometimes revert to shorter forms, especially when breaking from the game to write something.

That aside, I found your note asking me to be
"as clear as possible using full words please otherwise how the *#!@ am I supposed to understand?" perfectly legible :D . As an aside studies have been done on word shortening and comprehension -- vowels are often least needed with the first and last consonants being most important,
When you say
note 'r'=right mouse button on kb, and 't'=left mouse button.
What do you mean? do you mean r = {rmb} - or you are just sending the 'r' key?
in this game, 'rt' are mapped to same function as {rmb} & {lmb} -- and oddly enough, I was told to use 'r'&'t' because the mouse input was somehow different in a negative way (hard as I found that to believe).

Oh and there is no v2.28.8 - presume you meant v2.18.8?
Uh, ya.

As for trying in Notepad -- not yet, though might be able to since my mouse buttons are inserted as 'r' and 't' (mixed blessing). I guess I was hoping the program would do the non-chording mouse translations until I pressed the other mouse, then do the chorded translation then either stop, or go back to the unchorded keys if it was still pressed....i.e.

LMB....(tap RMB-chord)...then back to LMB & same (but reverse for RMB)...

Not sure if I should have the checkbox set to ignore normal input or not.
User avatar
Astara
Member
Posts: 21
Joined: Wed Jul 27, 2011 6:30 am

Re: trying to add chording, but not getting expected result

Post by Astara »

ok, my original macro works in notepad, but the one with the chording does not even work when I press the 1st key
(rt or lft mouse) which should be the same keys as in my first macro. I.e. not sure why it isn't the same. :-(

Though looking at the notepad window, I see some of my keys on the right side, like r-t-l writing was enabled.

Would it help to copy the configs in that seem relevant. I notice a large part of the config seems like it is filling in defaults where it doesn't need to (i.e. just saving parts that are not default would seem more efficient). But I might be able to trim them down..??
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: trying to add chording, but not getting expected result

Post by phil »

Ahhh I think the last paragraph of your first answer could be the key here..
I guess I was hoping the program would do the non-chording mouse translations until I pressed the other mouse, then do the chorded translation then either stop, or go back to the unchorded keys if it was still pressed....
I'm afraid that's not how chording works as things stand... The actions are not chained as such but independent. The chord will only be run if the two buttons are pressed very quickly in combination. After the initial action (on one button or two) has been initiated, the search for chords is over. And if a chord is running, releasing one of the buttons does not stop the chrord and start the single buttons' action. I can see why that might be nice (and in terms of musical instruments, that is how chords work...

Right now I'm struggling to get my head around the complexity of actually implementing it like that in XMBC. The whole lot would need to be pulled apart and reassembled differently - and its already over-complex so as things stand (with a long list if things todo already) I'm not going to make any commitments on if or when it may get done I'm afraid.

Regarding the config files - yes they are rather verbose. I had never considered only saving the non-default settings... An interesting idea which would be fine until some defaults changed... Maybe saving stuff for layers not defined is overkill and perhaps that's perhaps a good way to reduce loading times (although actually it may work in reverse - reducing the complexity of the file means increasing the complexity of the code and having to determin if the setting is there to be loaded might actually slow it down - wont know for sure until its tried - will depend on the 3rd party XML code I use and what is the slow/fast bits of that I guess) - a good thing to consider, especially as the config file structure was next on my list to enhance - good timing that suggestion..

PS. Yes I am aware of those language studies but I'm not sure how well that translates to describing technical detail - I mostly got confused by the r/t and wasn't sure if you meant r={rmb} and t={lmb} - the rest just made me doubt my understanding more :) now I understand that you meant you were sending keys that had the same effect as the left/right button.

Thanks for the clear reply and sorry to hear about the RSI.
--[ 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
Astara
Member
Posts: 21
Joined: Wed Jul 27, 2011 6:30 am

Re: trying to add chording, but not getting expected result

Post by Astara »

phil wrote: Mon May 18, 2020 9:33 am Ahhh I think the last paragraph of your first answer could be the key here..
I guess I was hoping the program would do the non-chording mouse translations until I pressed the other mouse, then do the chorded translation then either stop, or go back to the unchorded keys if it was still pressed....
I'm afraid that's not how chording works as things stand... The actions are not chained as such but independent. The chord will only be run if the two buttons are pressed very quickly in combination. After the initial action (on one button or two) has been initiated, the search for chords is over. And if a chord is running, releasing one of the buttons does not stop the chrord and start the single buttons' action. I can see why that might be nice (and in terms of musical instruments, that is how chords work...
-----
Arg...and sigh. That doesn't make it very useful, since it requires 2 keys to trigger, but each of those keys, it seems would be likely to have other functions.
Right now I'm struggling to get my head around the complexity of actually implementing it like that in XMBC. The whole lot would need to be pulled apart and reassembled differently - and its already over-complex so as things stand (with a long list if things todo already) I'm not going to make any commitments on if or when it may get done I'm afraid.
-----
I often find I have to refactor code to make new features work because my original design wasn't flexible enough.
Regarding the config files - yes they are rather verbose. I had never considered only saving the non-default settings... An interesting idea which would be fine until some defaults changed...
-----
Then wouldn't the new default be written out as things currently stand? Otherwise there is no reason to change it. Still, if you silently change defaults, seems like that would have its own problems.

But still in the transition between an old and and a new version, certainly the version of the old config is stored -- a conversion could take place. I.e. depends on whether you want to respect the old setting (thus store it), or default it to new in current profiles (don't store it).
Maybe saving stuff for layers not defined is overkill and perhaps that's perhaps a good way to reduce loading times (although actually it may work in reverse - reducing the complexity of the file means increasing the complexity of the code and having to determin if the setting is there to be loaded might actually slow it down
----
Cpu time is almost always cheaper than I/O. But I suspect the difference will be negligible unless you are writing to a floppy.

How about this, if the above is hard. Allow what I was describing or an alt definition to take over when a key is pressed, like a SHIFT/ALT/CTL, (etc)...Certainly allowing different presses for button vs. shift-button would be useful and desirable?

In similar fashion, if you had a button mapped to pressing 'w', pressing shift would temporarily have it emit 'W' and when shift is released, back to 'w'.

Personally and I think you agree, that's probably how the chording should work too -- don't look for single events, but allow multiple event to transition you to new states, like button1+button2 -- allow for any combo there (I suppose w/in reason, but Ctl-Alt-Shift+key are used in other programs) as well as with mice, think of the combs of drag+drop, meaning move+drop make-link and drop or copy +drop...


Anyway, hoping it gives you some ideas...
Or you sure you don 't want to open up the source some...? :D *cheers*
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: trying to add chording, but not getting expected result

Post by phil »

Ideas are fine, making changes is fine. Finding time to do it is not to easy I'm afraid.
Refactoring code at work which is my job is fine because I'm paid (currently) to do it and therefore I have the time (9-5++ everyday) to do it. XMBC is a hobby and I simply don't have much time to do it - so anything big is less likely to get the time allocated to do it - because I have a life outside of work and XMBC and I'm trying very hard to maintain a sensible balance!

This therefore means that the todo list is longer than I would like it, and there are things on that list which are going to be slow to get done. Given that XMBC started back before 2005, and chording only went in recently, that would mean chording took me over 10 years to get into XMBC in the first place (estimated as it wasn't suggested immediately)). Then button held actions were added (and at that point I realised I could have done the chording better!).

To be honest, its getting to the point where I open just up XMBC to all and say if your want to change it raise a pull request and DIY !:) But I fear that will be a different nightmare to manage too! Mouse hooks themselves are quite liming as to what you can do - if you start blocking all buttons and hen injecting replacements you get into a whole new world of pain with apps and games that block injected input (your mouse will simple stop working!). XMBC is not a mouse driver (no matter what some people think/call it) and a lo of these functions need driver level (filter driver) support - which isn't impossible but require driver signing certificates to do that sort of thing which is not a possibility for a hobbyist developer (only registered companies can get those in the first place and they are costly!).
--[ 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
Astara
Member
Posts: 21
Joined: Wed Jul 27, 2011 6:30 am

Re: trying to add chording, but not getting expected result

Post by Astara »

Well, along the lines of your last paragraph....if you opened up the source, you *could* cherry-pick back in changes you wanted. I mean you wouldn't have to pull in everything, but only those you felt didn't (or tested to not) cause problems. I.e. I understand the limited time thing -- and I have SW-eyes bigger than my fingers can implement/keep up with these days (sigh), even when my hardware isn't giving me grief on the side!

Anyway, you allowing people to try their own stuff in their own space doesn't commit you to diddly. And sometimes when they get their hands on whatever they thought they wanted, they get to find first hand that things are more complicated than they hoped.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: trying to add chording, but not getting expected result

Post by phil »

Yes thats a good point.... My main concern is lack of knowledge in shared dev type things - mostly of the stuff I do day to day is only shared between me and one other (and were working on separate areas) so my experience of GIT is rather limited in that area. I guess it would be a good way of learning all of that from my perspective too lol.
--[ 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)
Post Reply