/// <summary> /// Initializes a new instance of the <see cref="KeyboardInputEventArgs"/> class. /// </summary> /// <param name="rawInput">The raw input.</param> internal KeyboardInputEventArgs(ref RawInput rawInput) : base(ref rawInput) { Key = (Keys)rawInput.Data.Keyboard.VKey; MakeCode = rawInput.Data.Keyboard.MakeCode; ScanCodeFlags = rawInput.Data.Keyboard.Flags; State = rawInput.Data.Keyboard.Message; ExtraInformation = rawInput.Data.Keyboard.ExtraInformation; }
/// <summary> /// Initializes a new instance of the <see cref="HidInputEventArgs"/> class. /// </summary> /// <param name="rawInput">The raw input.</param> internal HidInputEventArgs(ref RawInput rawInput) : base(ref rawInput) { Count = rawInput.Data.Hid.Count; DataSize = rawInput.Data.Hid.SizeHid; RawData = new byte[Count * DataSize]; unsafe { if (RawData.Length > 0) fixed(void *__to = RawData) fixed(void *__from = &rawInput.Data.Hid.RawData) SharpDX.Utilities.CopyMemory((IntPtr)__to, (IntPtr)__from, RawData.Length * sizeof(byte)); } }
/// <summary> /// Initializes a new instance of the <see cref="MouseInputEventArgs"/> class. /// </summary> /// <param name="rawInput">The raw input.</param> /// <param name="hwnd">The handle of the window that received the RawInput mesage.</param> internal MouseInputEventArgs(ref RawInput rawInput, IntPtr hwnd) : base(ref rawInput, hwnd) { Mode = (MouseMode)rawInput.Data.Mouse.Flags; ButtonFlags = (MouseButtonFlags)rawInput.Data.Mouse.ButtonsData.ButtonFlags; WheelDelta = rawInput.Data.Mouse.ButtonsData.ButtonData; Buttons = rawInput.Data.Mouse.RawButtons; X = rawInput.Data.Mouse.LastX; Y = rawInput.Data.Mouse.LastY; ExtraInformation = rawInput.Data.Mouse.ExtraInformation; }
internal RawInputEventArgs(ref RawInput rawInput, IntPtr hwnd) { Device = rawInput.Header.Device; WindowHandle = hwnd; }
internal RawInputEventArgs(ref RawInput rawInput) { Device = rawInput.Header.Device; }