ATGTestInput.Input.GetAsyncKeyState C# (CSharp) 메소드

GetAsyncKeyState() 공개 정적인 메소드

Checks whether the specified key is currently up or down
public static GetAsyncKeyState ( Key key ) : bool
key Key The Key to check
리턴 bool
        public static bool GetAsyncKeyState(Key key)
        {
            int vKey = KeyInterop.VirtualKeyFromKey(key);
            int resp = UnsafeNativeMethods.GetAsyncKeyState(vKey);

            if( resp == 0 )
                throw new InvalidOperationException("GetAsyncKeyStateFailed");

            return resp < 0;
        }