[SecurityCritical] // auto-generated private static bool IsModKey(NativeMethods.INPUT_RECORD ir) { // We should also skip over Shift, Control, and Alt, as well as caps lock. // Apparently we don't need to check for 0xA0 through 0xA5, which are keys like // Left Control & Right Control. See the ConsoleKey enum for these values. var keyCode = ir.KeyEvent.WVirtualKeyCode; return(keyCode >= 0x10 && keyCode <= 0x12 || keyCode == 0x14 || keyCode == 0x90 || keyCode == 0x91); }
[SecurityCritical] // auto-generated private static bool IsKeyDownEvent(NativeMethods.INPUT_RECORD ir) => ir.EventType == NativeMethods.KEY_EVENT && ir.KeyEvent.BKeyDown;
[SecurityCritical] // auto-generated private static bool IsAltKeyDown(NativeMethods.INPUT_RECORD ir) => ((ControlKeyState)ir.KeyEvent.DwControlKeyState & (ControlKeyState.LeftAltPressed | ControlKeyState.RightAltPressed)) != 0;