public static bool GetKey(VKeyCode kc)
    {
        int i  = (int)kc;
        var ar = Instance._pollValues;

        if (i >= 0 && i < ar.Length)
        {
            return(ar[i]);
        }
        return(false);
    }
    public static bool GetKeyDown(VKeyCode kc)
    {
        int i      = (int)kc;
        var arPrev = Instance._pollValuesPrev;
        var ar     = Instance._pollValues;

        if (i >= 0 && i < ar.Length)
        {
            return(!arPrev[i] && ar[i]);
        }
        return(false);
    }
예제 #3
0
 public static short GetKeyState(VKeyCode code)
 {
     return(GetKeyState((int)code));
 }
예제 #4
0
 public static bool IsKeyPressed(VKeyCode code)
 {
     return((GetKeyState(code) & 0x80) != 0);
 }
예제 #5
0
 public static void Event( VKeyCode vk, byte scan, KEYEVENTF flags, UIntPtr extra )
 {
     keybd_event( (byte)vk, scan, (byte)flags, extra );
 }
예제 #6
0
 public static bool IsKeyDown(VKeyCode code)
 {
     return((GetKeyState(code) & 0x100) != 0);
 }