0

I am writing a program for educational purposes that counters the recoil in a FPS game. I came across a problem that I didn't know how to solve and was wondering if you could point me in the correct direction. My problem is, I would like to check if the left mouse button is down or up but not for the application itself. As I said above, this is to counter the recoil in a FPS; this means that I want to check weather I am shooting or not inside of the game. Some pseudo code is shown below:

Main:
    while (GetLMBDown) do:
        Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y + 5);

Please tell me if you need anymore information and I'll try my best to supply you with it! Please note, this is a console application.

Kinggadino
  • 47
  • 9
  • See for WPF http://stackoverflow.com/questions/11868956/how-do-you-detect-a-mouse-double-left-click-in-wpf or for winforms http://stackoverflow.com/questions/14645233/detecting-a-left-button-mouse-click-winform – Elizabeth Schneider Dec 16 '14 at 03:38
  • I'm creating this as a console application, sorry I forgot to mention it! – Kinggadino Dec 16 '14 at 03:54
  • If you want to do this for another application then the other application is executing. It is not clear to me how your console application is executing when it needs to check the status of the mouse for another application. Something is not clear. – Sam Hobbs Dec 16 '14 at 06:03
  • To @user34660 so it is impossible without injecting something into the game? I was trying to do it without injecting anything. – Kinggadino Dec 16 '14 at 06:39
  • 1
    Have a look at http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C – Ken Kin Dec 16 '14 at 07:19
  • I did not say it is impossible without injecting something into the game, I am saying it is not clear what you need to do. The usefulness of responses usually depend on the clarity of the question. – Sam Hobbs Dec 25 '14 at 23:22

0 Answers0