This is not work on Windows 10
thienquang07 opened this issue ยท 4 comments
I had done follow the instruction. My code can build without problems, but it has no effect. Nothing happens, keystroke or mouse click not work on any app: games, chrome or notepad...
I did active the target app using SetForegroundWindow() before sending keystroke or mouseclick.
Is there anyone could make it work on windows10? Please give me some advice!
I had a similar problem at first, but it ended up being my own mistake. Here are a few things to double check:
- Are you calling the Load() method on the Input object?
- Is Interception installed correctly? Have you restarted since installing it?
- Are you setting the KeyboardFilterMode and MouseFilterMode to "All" or the correct mode?
- The Load() method returns a bool, whether it worked or not. Have you checked to make sure this bool is coming back as "true"?
If not, please provide code samples for further aid!
Oh yes, after check the Load() method, it returned "false" value.
And when I go inside the Load() method, the reason is the InterceptionDriver.CreateContext() return IntPtr.Zero value.
public bool Load()
{
if (IsLoaded) return false;
context = InterceptionDriver.CreateContext();
if (context != IntPtr.Zero)
{
callbackThread = new Thread(new ThreadStart(DriverCallback));
callbackThread.Priority = ThreadPriority.Highest;
callbackThread.IsBackground = true;
callbackThread.Start();
IsLoaded = true;
return true;
}
else
{
IsLoaded = false;
return false;
}
}
I did put the "interception.dll" file in right place. I really don't know why this happens.
Could you show me how to fix that?
Thanks in advance!
Crashed to same problem
Same problem over her.
Edit: It works, see this comment.
I have successfuly tested this with GTA 5.
First of all, make sure you have installed this driver correctly, see this comment.
Then, you have to press any key on the keyboard so that the program recognizes keyboard's id.
The driver has a limitation in that it can't send keystrokes without receiving at least one keystroke. This is because the driver doesn't know which device id the keyboard is, so it has to wait to receive a keystroke to deduce the device id from your keystroke.
In summary, before sending a keystroke, always physically press the keyboard once. Tap any key. Then you can send keystrokes. This doesn't apply to receiving keystrokes, because by receiving a keystroke, you have of course already pressed a key.
As I only have 1 keyboard, I have changed this line to deviceId = 1; // (my keyboard's id)
so that I don't have to press a key first because this value was already set.
To get my keboard's id I added a Console.WriteLine(deviceId);
after this line