inputsimulator icon indicating copy to clipboard operation
inputsimulator copied to clipboard

issue: doesn't work with apps that require scancodes, fix within

Open binary1230 opened this issue 11 years ago • 8 comments

I was trying to use this with ZSNES and it wasn't working. I noticed after playing around with Spy++ that it only worked if you send the scanCode

my fix was: add to NativeMethods:

        [DllImport("user32.dll")]
        public static extern uint MapVirtualKey(uint uCode, uint uMapType);

add to InputBuilder::AddKeyDown() the following at the top:

ushort scanCode = (ushort)Native.NativeMethods.MapVirtualKey((uint)keyCode, 0);

and then below change Scan = 0 to Scan = scanCode

If you want I can submit a patch though it's really simple. However, there may be other places where you need to update it to use the scanCode

binary1230 avatar Jun 15 '14 22:06 binary1230

oh and you have to do it with AddKeyUp()

binary1230 avatar Jun 15 '14 22:06 binary1230

Thanks for that Dominic. I'll see if I can get an update through soon.

I'll have to check out ZSNES sometime too! ;)

On Mon, Jun 16, 2014 at 8:42 AM, Dominic Cerquetti <[email protected]

wrote:

I was trying to use this with ZSNES and it wasn't working. I noticed after playing around with Spy++ that it only worked if you send the scanCode

my fix was: add to NativeMethods:

    [DllImport("user32.dll")]
    public static extern uint MapVirtualKey(uint uCode, uint uMapType);

add to InputBuilder::AddKeyDown() the following at the top:

ushort scanCode = (ushort)Native.NativeMethods.MapVirtualKey((uint)

and then below change Scan = 0 to Scan = scanCode

If you want I can submit a patch though it's really simple. However, there may be other places where you need to update it to use the scanCode

— Reply to this email directly or view it on GitHub https://github.com/michaelnoonan/inputsimulator/issues/5.

michaelnoonan avatar Jun 15 '14 22:06 michaelnoonan

sweet : )

binary1230 avatar Jun 15 '14 23:06 binary1230

I am also facing the same issue with citrix terminal . Key down and key up are not working. I see a pull request by @TChatzigiannakis which seems to address the issue. @michaelnoonan - Could you please look in to that PR #13 and accept the changes?

Nfactor26 avatar Dec 12 '17 08:12 Nfactor26

Having problems with this also, when it is getting accepted as a change??????

RudiHansen avatar Jul 29 '18 18:07 RudiHansen

@RudiHansen You can use my fork where this issue is addressed.

TChatzigiannakis avatar Jul 29 '18 20:07 TChatzigiannakis

Thanks @TChatzigiannakis that solved my problem

RudiHansen avatar Jul 30 '18 13:07 RudiHansen

I think this was fixed, aside from LMENU #27

dantman avatar Nov 24 '19 05:11 dantman