Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse clicks doesn't work on Windows 10 #10

Open
barak1413 opened this issue Nov 6, 2017 · 5 comments
Open

Mouse clicks doesn't work on Windows 10 #10

barak1413 opened this issue Nov 6, 2017 · 5 comments

Comments

@barak1413
Copy link

I tried to change the MouseState enum values with no success.

By the way, thanks for great project!

@SaveTheHuman5
Copy link

SaveTheHuman5 commented Jan 19, 2018

Hello Barak i see you fix the problem checking stackoverflow.
https://stackoverflow.com/questions/47151718/simulate-mouse-clicks-in-kernel-space
I think you make reference to mouse id
InterceptionDriver.Send(context, 12

Please can explain how you do?
What number should be instead 12?

Really apreciated some help

@liq19ch
Copy link

liq19ch commented Mar 15, 2020

Hi,

To get the mouse id:

  1. Set both keyboard filter and mouse filter when initialising the input object.

        input = new Input();
        input.KeyboardFilterMode = KeyboardFilterMode.All;
        input.MouseFilterMode = MouseFilterMode.All;
        bool isLoad = input.Load();

  1. Add a global variable mouseId in Intercepter.Input.cs

  •       private int mouseId;
    

  1. Get the mouse id in DriverCallback function (Also in Intercepter.Input.cs)

    private void DriverCallback()
    {
    ....
    if (InterceptionDriver.IsMouse(deviceId) > 0)
            {
  •               mouseId = deviceId;
    
                  if (OnMousePressed != null)
                  {
      ....
    

  1. Change the mouse from 12 to mouseId in the following functions

SendMouseEvent

MoveMouseBy

MoveMouseTo


Remember to the bool useDriver from false to true.

@barak1412
Copy link

On my platform the correct mouse device is 11.

@taejun13
Copy link

Thank you. saved my life. mine was also 11.

@Jamisco
Copy link

Jamisco commented Nov 26, 2020

Yup, correct device is 11

For anyone not being able to send mouse clicks,
try going into the Inteceptor.SendMouseEvent method

and in the line
InterceptionDriver.Send(context, 12, ref stroke, 1);

change the 12 to 11, so now the line looks like this

        InterceptionDriver.Send(context, 11, ref stroke, 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants