2

As you may know, in the VBE if you right click on the tool bar and select customize, then right click on a tool bar button you can add an ampersand (&) in front of a letter to create a shortcut using the ALT key.

Is it possible to set a shortcut using the CTRL key? If so, what's the symbol?

enter image description here

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
pheeper
  • 1,457
  • 4
  • 20
  • 37
  • 2
    This is a Windows feature called Accelerator keys. They work with `Alt`. – GSerg May 03 '18 at 16:15
  • You may try to assign some unused accelerator keys, and use a [keyboard remap app](https://www.google.com/search?q=remap+keyboard) to translate desired shortcuts to accelerator keys. – omegastripes May 03 '18 at 17:31

1 Answers1

1

The & ampersand isn't a shortcut or configurable hotkey, it's an accelerator key, which behaves that way (i.e. responds to the Alt key) at a rather low level, consistently across anything running on Windows.

No, you can't make accelerator keys work with the Ctrl key - the VBE has no say in that.

What you want is to assign a hotkey to certain IDE commands.. unfortunately the VBE doesn't allow configuring its hotkeys as far as I know.

You could write a VBIDE add-in (in VB6 if 32-bit-only is fine, or in .NET through COM interop for compatibility with 64-bit hosts) that enhances the VBE with such an ability though, but as the main project manager for Rubberduck (which does have configurable hotkeys for its own commands) I have to say that writing a .NET VBIDE add-in is a bit of a mine field. It's fun though =)

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
  • Accelerator key must have slipped my mind when posting, thanks for the correction. Adding a hotkey seems like far more work than I'm willing to do for this, but thanks for the through answer! – pheeper May 03 '18 at 20:27