The easiest way to achieve this request is by using actions (good article by Brian Long:
http://blong.com/Articles/Actions/Actions.htm, but ignore the part about ActionManager which does not exist in Lazarus).
The attached demo contains three actions, one to open a file dialog, one to exit the application, and one to toggle visibility of the main menu. The short cuts CTRL+O, CTRL+X and CTRL+M are assigned to these actions, respectively. Each action is assigned to a menu item, and thus the menu items get the caption, shortcut and click handler from the associated action.
Run the demo, the main menu is shown by default (by changing the code you could turn it off initially equally well). Press CTRL+M (toggle menu), and the menu disappears. Press CTRL+O and the file dialog opens although the mainmenu is hidden. Press CTRL+M again, and the menu reappears although it was hidden.
As you can see, the shortcuts are working even when the menu is turned off, and all this without writing any line of code (except for the code needed to show/hide the menu).