jasonpang / Interceptor

C# wrapper for a Windows keyboard driver. Can simulate keystrokes and mouse clicks in protected areas like the Windows logon screen (and yes, even in games). Wrapping http://oblita.com/Interception
MIT License
286 stars 84 forks source link

Some part in the sample code didn't work. #18

Open phattanun opened 4 years ago

phattanun commented 4 years ago

Capture I copied exactly the same code from the example. but some of them didn't work and I don't know why. The following code didn't working (with error explanation)

input.KeyDelay = 1;
// 'Input' does not contain a definition for 'KeyDelay' and no accessible extension method 'KeyDelay' accepting a first argument of type 'Input' could be found (are you missing a using directive or an assembly reference?)

input.SendKeys(Keys.Enter, KeyState.Down);
//cannot convert from 'Interceptor.KeyState' to 'Interceptor.Keys'  

input.SendKeys(Keys.Enter, KeyState.Up);
// cannot convert from 'Interceptor.KeyState' to 'Interceptor.Keys'

input.Unload();
// not support on this platform
liq19ch commented 4 years ago

Hi,

It's an open source library. You can check the code.

They merely change the names of some variables.


        input.KeyPressDelay = 10;
        input.SendKey(Interceptor.Keys.Enter, KeyState.Down);
        Thread.Sleep(10);
        input.SendKey(Interceptor.Keys.Enter, KeyState.Up);

KeyDelay > KeyPressDelay

SendKeys(Key, State) >SendKey(Key, State)