/// <summary> /// Makes a snapshot of a keyboard state to the moment of call and returns an /// instance of <see cref="KeyboardState" /> class. /// </summary> /// <returns>An instance of <see cref="KeyboardState" /> class representing a snapshot of keyboard state at certain moment.</returns> public static KeyboardState GetCurrent() { var keyboardStateNative = new byte[256]; KeyboardNativeMethods.GetKeyboardState(keyboardStateNative); return(new KeyboardState(keyboardStateNative)); }
/// <summary> /// Makes a snapshot of a keyboard state to the moment of call and returns an /// instance of <see cref="KeyboardState" /> class. /// </summary> /// <returns>An instance of <see cref="KeyboardState" /> class representing a snapshot of keyboard state at certain moment.</returns> public static KeyboardState GetCurrent() { var bytes = new byte[256]; accessor.ReadArray <byte>(0, bytes, 0, 256); HandledDownKeys = new KeyboardState(bytes); var keyboardStateNative = new byte[256]; KeyboardNativeMethods.GetKeyboardState(keyboardStateNative); return(new KeyboardState(keyboardStateNative)); }
// Token: 0x060002C2 RID: 706 RVA: 0x0000E8A0 File Offset: 0x0000CAA0 public static KeyboardState GetCurrent() { byte[] array = new byte[256]; KeyboardNativeMethods.GetKeyboardState(array); return(new KeyboardState(array)); }