private static void GetCurrentInputState(ref byte[] state) { Application.DoEvents(); NM.GetKeyState(0); NM.GetKeyboardState(state); }