How do I Open/Close my option menu with one key C#

I wan’t to be able to toggle on/off a option menu in my game And i’m confused on how to do that, I figured out how to open it but I don’t know how to close it with the same key.

public Canvas IngameOption;

// Use this for initialization
void Start () {

    IngameOption = IngameOption.GetComponent<Canvas>();

    IngameOption.enabled = false;

}

// Update is called once per frame
void Update () {
    if (Input.GetKeyDown("escape"))
    {
        IngameOption.enabled = true;
    }	
}

}

It can be done like this

public Canvas IngameOption;
private bool menuEnabled = false; // call this whatever you want

// Use this for initialization
void Start ()
{
    IngameOption = IngameOption.GetComponent<Canvas>();
    menuEnabled = false;
    IngameOption.enabled = menuEnabled;
}

// Update is called once per frame
void Update ()
{
    if (Input.GetKeyDown("escape"))
    {
        menuEnabled = !menuEnabled;
        IngameOption.enabled = menuEnabled;
    }    
}