Simulated keys bug in version 2.16.1

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
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Simulated keys bug in version 2.16.1

Post by Syziph »

in version 2.16.1
For middle mouse Wheel Up

Operaion: Simulated keys: (pressed)[(facepalm)]
Target: Skype IM Window

(facepalm) returns the string (facepalm0
while
facepalm) returns correctly facepalm)

Can somebody confirm the same result?
This worked fine in previous versions. I did a lot of facepalming :)
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Thats odd - I cant, off the top of my head think how the minimal changes in 2.16.1 could affect this but I'll take a look
Did you come from 2.16 or an earlier version?

In the meantime, does '{shift}9facepalm{shift}0' work?
--[ 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)
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Re: Simulated keys bug in version 2.16.1

Post by Syziph »

Yes, I do automatic updates.
I haven't noticed any problems before but not completely sure when they appeared.

'{shift}9facepalm{shift}0'

returns

'(facepalm)'

{shift}9facepalm{shift}0

returns

(facepalm0

So I assume if ) is not the last character it is typed correctly :)

Edit:

{shift}9facepalm{shift}0'
returns
(facepalm0'

so it is not because of the character position but the single quotes maybe?
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Its very odd, I just tested it here and it works fine (in notepad).
Can you try changing the delay between simulated keys (settings->general) and see if a higher number makes any difference?
Can you also try in notepad and see if you have the same problem, or if it works like it does for me?

PS, I didn't intend you to put the single quotes in the simkey sequence (but that works for me too).
--[ 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)
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Re: Simulated keys bug in version 2.16.1

Post by Syziph »

I tested the keystrokes in Notepad as you proposed. It gives the same bad result, but when scrolling repeatedly some of the keystrokes return the correct character.

Last night I tested the sequence with another mouse. It worked just fine.

So I think it's not a bug, just bad scroller :(
But still I haven't had problems with the same mouse in previous versions.
I could try to see on which version it worked.
Is there a whay to download previous versions of the program?
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Oh I completely missed the fact that you were using this on the scroll wheel... That might just make a little more sense to me now because of the way the scroll wheel behaves.

Have you enabled the option "ignore repeated vertical scroll" on the options tab? if so, how many milliseconds for? If not, can you turn that on?

Here is a links to a few older versions... but please try the above first (so we can at least understand it). Thanks,
Phil
--[ 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)
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Re: Simulated keys bug in version 2.16.1

Post by Syziph »

Hi, Phil!
I tried the "ignore repeated vertical scroll" option with different times with no succsess.
However downgrading to version 2.15 removes the problem.

Again unsure if that is a bug or hardware malfunction.

If the model of the mouse is important:
Logitech Performance Mouse mX
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Its almost certainly a bug of some sort... I'm guessing the changes in 2.16 (presume that does not work) have introduced this behavior.
Will see if I can reproduce on the wheel... It may be influenced by hardware (could be the mouse or the CPU speed etc.), but it sounds like a bug to me :(
--[ 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
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

I *think* I understand what is going on.... And I think it is a timing issue, and it just so happens that the timing has changed (enough to make a difference) between 2.15 ans 2.16/2.16.1 (2.16 is probably slightly faster and thus suffers more - the problem *could* still exist in 2.15 as far as I can see, I think its just luck that it doesn't (and I dont like that!))...

When sending shifted keys, the simkey expression is parsed, and it checks if shift is already pressed, if it is, it does not simulate the shift.
The problem is, that in the time between parsing, and actually sending, shift has been released again, so 9 or 0 are sent instead on ( or ).

That's why on my machine it behaves differently (I did manage to reproduce on the wheel once or twice in a sequence of 10(ish).
Moving the check if SHIFT is already pressed, closer to the time its sent might help, but still there is a chance if could go wrong, if the keyboard buffer injection is slow (e.g. if the CPU is busy), the problem could occur - actually I'm not so sure there can be a perfect/guaranteed solution using the SendInput API :(

Does it always produce the correct result on the first scroll, and then subsequently random, sometimes working, sometimes not, or was it even wrong on the first scroll (which might invalidate my theory!)???

Thanks,
Phil

EDIT: I have tried removing the check if the extended key (shift, ctrl, alt etc.) is already down and sending it anyway. This works much better (and will be less resource intensive too!). The only time it could go wrong is if you are actively pressing/releasing the key on the real keyboard at the same time... I guess that's unlikely to happen (although there must be a reason I went down this route in the first place lol). I guess we shall have to see how it plays out, I will include this change when I start the 2.17 beta run (and try and remember to let you know so you can test it for me :)).
--[ 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)
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Re: Simulated keys bug in version 2.16.1

Post by Syziph »

Thanks for the explanation, Phil!

The tests (of version 2.16.1) with different mice was performed also on different machines, even different operating systems.
With the Logitech mouse (on Win 7 Ultimate) the program failed at every attempt, and with Rapoo mouse (on Win 8 Pro) the program was successful every time.

Anyway thank you for looking into it.
Looking for the next update. I will let you know if the problem is fixed then.

Best regards!
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

OK, I'm not sure if it failed on every attempt, why that would be, but either way my "fix" should improve things.
--[ 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
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Syziph wrote: Fri Jun 30, 2017 11:09 am Looking for the next update. I will let you know if the problem is fixed then.
I've made 2.17 beta 1 with this change. Please see how that works for you in relation to this issue. Get it from the beta thread on the forum.
--[ 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)
Syziph
New User
Posts: 10
Joined: Sat Jan 04, 2014 9:28 pm

Re: Simulated keys bug in version 2.16.1

Post by Syziph »

Hi, Phil!
I've downloaded the beta 2.17.1
You did your magic and the problem is no longer.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keys bug in version 2.16.1

Post by phil »

Brilliant - thanks for letting me know :)
--[ 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