Jump to content

Alternate Send? (low-level keyboard send)


 Share

Recommended Posts

I saw a long time back someone had made a different MouseMove function that controlled the mouse from a lower level, allowing it to be manipulated even when another program may be doing strange things with it. I can't seem to find it anymore, but I don't need it anyway.

What I need is something like that for the Keyboard.

I'm trying to automate a small series of actions in a program, the actions are triggered via keyboard commands. The program I'm working in does strange things though, if I'm hitting keys on the keyboard (even unrelated), my AutoIT commands will go through like they should, but If I hit an unrelated key only once, AutoIt will only succeed in sending the first command, the following commands do nothing.

This probably seems like a strange problem, so just to be clear, If I write a simple macro to:

WinActivate("Window")

Sleep(1000)

Send("3")

Sleep(1500)

Send("2")

Sleep(1500)

Send("1")

The following will happen:

Simply hitting 'go' in Scite = Widow Focuses, nothing happens

Hitting go, waiting for focus, then tapping an unused key once = "3" is sent, nothing else

Hitting go, waiting for focue, then continuously tapping an unused key = everything works fine.

Hitting 3 = Hard to tell, but it seems like the keyboard wins out over autoit

Hitting a used key = used key wins

It seems like the program will only accept AutoIT commands if it detects the keyboard is being used, though it doesn't seem to care if the keys AutoIT sends correlate to Keys being used on the keyboard.

My goal is to be able to pass commands without having to sit and pound on an unused key (kinda defeats the purpose). I've tried sendkeydelay etc, but they seem to be unrelated to the problem.

Any help appreciated.

Link to comment
Share on other sites

  • 1 month later...

I believe I know the game you are working with and I had the same problem. I found a solution using Microsofts DDK(Driver Development Kit). I used the sample code referred from here. This creates a simulated USB HUB and Keyboard. Then I added a little bit of code to make the sample work like a proxy keyboard driver. Now I send all my keystrokes to the proxy keyboard app which sends then to the target destination.

I'm not a not the best coder and this was relatively easy. It was the research that took the most time. Hope that helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...