private static bool IsKeyDownEvent(Interop.InputRecord ir) { return (ir.eventType == Interop.KEY_EVENT && ir.keyEvent.keyDown); }