rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 302 forks source link

Hotkeys often detach when window focus changes #5393

Open Greedquest opened 4 years ago

Greedquest commented 4 years ago

Rubberduck version information

Version 2.5.0.5325 OS: Microsoft Windows NT 10.0.18362.0, x64 Host Product: Microsoft Office x86 Host Version: 16.0.11929.20562 Host Executable: EXCEL.EXE

Description Rubberducks hotkeys often become detached/stop working over the course of a session. I've noticed it most with Ctrl+Shift+E or Ctrl+' as I use them often, but I imagine this is true of many of RD's custom shortcuts. I'm not sure exactly what causes it, I think it's something to do with changing focus from a RD window to a VBE one, but I've managed to reproduce quite consistently on my machine

To Reproduce

  1. Open a new instance of Excel and start a new project
  2. Do a clean reparse
  3. Bring up the classic project explorer (Ctrl + R) or click into the immediate window
    • This may require a few clicks/ some waiting
  4. RD's shortcuts no longer work while a VBE window is focussed

Workaround A workaround to deal with this:

Or just click on RD's Code Explorer window

Greedquest commented 4 years ago

PS, possibly related:

The hotkeys are supposed to disengage whenever the VBE is no longer the active window*

but this feels like an inversion; hotkeys are disabled when switching away from RD to the VBE

bclothier commented 4 years ago

Duplicates: #5081 , #4198, and #3996

They all cover a bit different aspects but we should consolidate those 4 issues together since I believe they fundamentally have the same root cause: hotkeys aren't consistently working.