2
votes

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.).

1
If your caption is '&Save', that means it should be fired by Alt+S combinations and optionally by single S if no textedit box in the way. You are to choose if you want windows-standard accelerators (then drop Ctrl+S) or you custom (then drop accelerator). &S means Alt+S in Windows.Arioch 'The

1 Answers

3
votes

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.