Change methods for working with menu items that accept a numerical index to alternatively accept the menu item element itself. Hide the context menu when the ESC key is pressed.