Can the same shortcut key have different effects in different situations?
Answered
F5 has different meanings in VSCode depending on the context, is there a similar mechanism in JetBrains?
If I want to implement 'F5 is Resume Program when debugging and DeBug at other times', how should I do it?

Please sign in to leave a comment.
You can assign the same shortcut to different actions via IDE Settings (Preferences on Mac OS) | Keymap. For example, set F5 both to Run | Debug (or Run | Debugging actions | Resume program action if needed) and e.g. Terminal | Run highlighted command using IDE.
For more details about defining custom keymaps please see the corresponding Help article.