In Lazarus, I want to programmatically delete a menu item (say under the File menu) during runtime. The user will open the File menu to list all its items, then use the arrow keys to go to a specific (deletable) item, like a recently used file, and press Del key to delete that menu item from the File menu.
How can I capture the event of Del key being pressed while a specific menu item is selected (highlighted) by the user?
Please note that I am coding for both Windows and Linux (GTK2) at the same time. So, I would need a "standard" (Lazarus-way of) solution that will work on both systems: Suggested Windows-related answers are not appropriate in my case.