I have an action assigned to a BitBtn and to a menu item.
The action’s caption is ‘&Save’ (has an accelerator on s). The shortcut for this action is ‘Ctrl+S’.
When I run the app and press the S key the action is executed because of the accelerator. I think is pretty odd. The user sees that the keyboard shortcut is ‘Ctrl+s’ but still the action is executed with ‘s’.
The program says something but does something else – this could be considered a full fledged bug. Right?
Plus that if there are multiple actions with similar shortcuts (ctrl+s, ctrl+shift+s, etc) or many menus with items with ‘s’ as accelerator the user will be very very confused about why ‘s’ does ‘save file’ and not ‘save project’.
I want the action executed with ‘Ctrl+s’. How do I do that?
(I know that I could edit button’s caption to remove its accelerator’ but if I reassign the action to the button I will have to remember to re-edit button’s caption. There are too many actions and buttons there.).
That is normal behaviour. That’s how keyboard accelerators have always worked and are meant to work. The way to stop the S key invoking a button click is to remove the accelerator.