When using quick fixes in RD, method shortcut keys are sometimes (always?) lost.
Tentative steps to reproduce:
Possible solutions:
There appear to be two methods here that would work
https://social.msdn.microsoft.com/Forums/en-US/7681fa96-4f83-4747-93e1-281db81e316d/assigning-keyboard-shortcut-to-vba-macro-programmatically?forum=isvvba
I think that's a VBE quirk - editing the signature of the method, whether manually or with Rubberduck, tends to obliterate the VB_Attributes (and the shortcut key is a VB_Attribute).
Also, I think that MSDN fix only applies to Excel.
If the attribute annotations included the shortcut key, then the rewriter would be able to reinstate the VB_Attribute.
@ThunderFrame TIL. And as a bonus you get the hotkey visibly documented in the editor.
This should be fixed by upcoming PR #4686
Losing the attribute should be already fixed now, but @ThunderFrame's idea should still end up being implemented:
'@HotKey("T")
Public Sub DoSomething()
Attribute DoSomething.VB_ProcData.VB_Invoke_Func = "T\n14"
End Sub
The hotkey string/character is case-sensitive, and the Ctrl modifier is implicit. The attribute value simply needs to take (+validate) that character, append "\n14" (which presumably stands for the Ctrl modifier key).
Actually the annotation should be @ExcelHotKey, since it's apparently Excel-specific. https://stackoverflow.com/a/36961298/1188513
Most helpful comment
Also, I think that MSDN fix only applies to Excel.
If the attribute annotations included the shortcut key, then the rewriter would be able to reinstate the VB_Attribute.