Say I have a form, with a menu bar on it. I have an item on the menu bar, a TMenuItem
, for which I can assign a shortcut key combo, say, for example Ctrl+I. But when I assign the ShortCut
property for the TMenuItem
, it seems to just change the visual appearance of the menu item to show the shortcut code rather than automatically listening for the short-cut key to be pressed and triggering my ActionManager code.
My google-fu seems to be failing today, I'm only finding articles about how to assign global-hot-keys for windows, not how to assign application-specific hot-keys that only work on the active form.
Can anyone outline for me the steps necessary to add a hot-key beyond just adding the shortcut property in the menu. I'm thinking somewhere I probably need to set the form to be listening for keyboard input and trap the keypress and respond to it? But I'm not exactly sure where or what the Delphi way to do that would be.
ShortCut
property of theTAction
, not theTMenuItem
. – Hogg