1

Re: Refactor! C++ and ESC from INSERT

I realized that this topic has shown up several times but I believe I've tried all the suggestions and I still can't get the ESC key to exit from INSERT mode.

I'm currently using Refactor! for C++ Version 2.2.2 and ViEmu 2.1 (evaluation) under VS 2005.

Once I enter INSERT mode, the only way to leave seems to be Shift-ESC.

I've deleted all mappings under Tools/Options/Environement/Keyboard related to the ESC key (I think).  (Including Windows.ActivateDocumentWindow, Window.CloseToolWindow, and Edit.SelectionCancel).

I've added  DXViEmuCompat.dll to the C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins folder.

The only way I can get this to work properly is to Disable DevExpress Tools via the Add-In Manager (Tools/Add-In Manager...).

There was a mention of:
     "...by removing all CodeRush assignments to the Esc key, in DevExpress->Options->IDE->Shortcuts" 
but I couldn't find this entry.

Have I missed something?

Thanks!

2

Re: Refactor! C++ and ESC from INSERT

Hello,

I'm not really sure exactly what it can be. The only thing DXViEmuCompat.dll does is detect some specific CodeRush/Refactor commands and enter insert mode automatically. Also, I got the solution described about removing all Esc assignments by trying with a trial version a few months ago. I remember I had to remove not only Esc assignments, but also all combinations including Esc (such as Shift-Esc, Alt-Esc, Ctrl-Esc, etc...) so that CodeRush/Refactor would allow the keypress of raw Esc to go through (maybe that will help?).

I'm currently giving the finishing touches to Codekana, to be released next week, and I will be able to get back to you to explore this issue in more detail after that. Apologies for the problems. Interactions between VS add-ins are notoriously tricky to debug.

Best regards,

  Jon

3

Re: Refactor! C++ and ESC from INSERT

I think Ctrl + [ is much more convenient. maybe it works for you?!

Last edited by kroiz (2007-07-21 20:42:28)

4

Re: Refactor! C++ and ESC from INSERT

Hello

  It seems that the problem is that DxCore also catches the esc button.
You can change DxCore's behaivioir under Menu DevExpress->Options, then IDE->Shortcuts,
and change the esc assignemt under DxCore->Support

  Good luck

  Ronnie

5

Re: Refactor! C++ and ESC from INSERT

Ronnie,

Are you referring to the VS2005 Menu?  I can't find anything that references DevExpress except under the Add-Ins Manager.

I also looked at the XP Start Menu but could find nothing like the menus you mentioned.  What am I doing wrong?

Thanks,
Mark

6

Re: Refactor! C++ and ESC from INSERT

I am not too familiar with CodeRush and Refactor, but I think there was a separate "DevExpress" menu, which provided a link to a huge settings UI, with general topics on the left and specific panels appearing on the right.

7

Re: Refactor! C++ and ESC from INSERT

I'm only using the "Refactor for C++", Not the full blown CodeRush (I guess).  I don't see any options anywhere.   Or perhaps I'm just not looking in the right place.  Definately no DevExpress menu however.

8

Re: Refactor! C++ and ESC from INSERT

I think they have a common core called "DXCore", on top of which both Coderush and Refactor are built. I only tried this DXCore & Coderush once, and they definitely had some type of menu like this.

Where does Refactor have the settings screen? Or, how do you configure the shortcut keys? If it's only through the standard Tools|Options|Keyboard?

If we can't solve it this way, I'll send you an instrumented build of ViEmu, so that we can generate a log and try to understand what is happening.

Regards,

  Jon

9

Re: Refactor! C++ and ESC from INSERT

Jon,

For the life of me, I just can't find any sort of options page anywhere. 

There are only three "Coderush." entries in the Tools/Options/Environment/Keyboard panel and they are currently mapped to nothing.

There are also 7 "Refactor." entries in the Tools/Options/Environment/Keyboard panel and they are currently mapped to nothing.

When using Refactor! for C++, when your cursor or highlighted region represents a set of code that is appropriate for refactoring, the context menu (Right Mouse Click) contains an entry called "Refactor!" with sub entries of what type of Refactorings you can perform.  This seems to be the only interface with the Add-In.

I hope this helps. It appears that at some point you'll have to send me an instrumented version.

Thanks,
Mark

10

Re: Refactor! C++ and ESC from INSERT

I am having the same problem. I don't think Refactor! for C++ (2.2.2) has the same options as Coderush.

I am using ViEmu 2.1.6.

11

Re: Refactor! C++ and ESC from INSERT

I am downloading Refactor for C++ (I didn't know it was freely available), and I'll be trying to reproduce the problem in order to fix it. I'll post here about my findings.

ding3r, in any case, I recommend you upgrade ViEmu to 2.1.13, the latest version.

Regards,

  Jon

12

Re: Refactor! C++ and ESC from INSERT

I've tried it and it happens here too, I will investigate in depth tomorrow and post about the results.

13

Re: Refactor! C++ and ESC from INSERT

Ok, I got this to work. I didn't have to do anything to ViEmu, just follow the following steps:

  1) Download DevExpress's 'DXCore' from this address:

         http://www.devexpress.com/Downloads/NET/IDETools/DXCore/

  2) Install it. It will prompt you what to do, say 'Repair' (since you have a version of DXCore installed from your Refactor for C++ install)
  3) Follow the installer instructions (nothing weird here)
  4) Start up VS2005, you will now have a menu called 'DevExpress' (at last!)
  5) Go to DevExpress->Options->IDE->Shortcuts
  6) Go through all entries, be sure to open all folders (some are closed by default), and remove all shortcuts that include Esc (ie, 'Esc', 'Shift+Esc', etc...)
  7) Click Ok
  8) Now Esc should work properly with ViEmu!

Pretty ugly of the DevExpress guys that they'd remove the shortcut configuration dialog from Refactor for C++. Anyway, since you can download the standard DXCore (it's free), you can use the configuration dialog there.

Possibly, if you just check the checkbox 'After executing this command pass shortcut on to IDE for default handling' on all of the entries above, it will also fix the problem, but I haven't tried. If not, you'd need to find reasonable alternatives to the regular Esc assignments.

Regards,

  Jon


[Update: you can probably just modify the .ini files in "C:\Documens and Settings\{username}\Application Data\CodeRush for VS.NET\1.1\Settings", but it will be manual and uncomfortable, searching for "KeyCode=27" removing the entries, and renumbering the remaining ones]

14

Re: Refactor! C++ and ESC from INSERT

VERY COOL!

Thanks so much.

The first thing I tried was to check the "After executing this command, pass shortcut on to IDE for default handling" checkbox for each ESC key mapping.  After doing this, everything appears to be working great.

Thanks again for all your efforts.

15

Re: Refactor! C++ and ESC from INSERT

You're welcome, glad it worked.

16

Re: Refactor! C++ and ESC from INSERT

Awesome! I too had this issue and this fixed it for me as well.
Thanks!!!

17

Re: Refactor! C++ and ESC from INSERT

Great to hear that, I'm happy you got it fixed!

18

Re: Refactor! C++ and ESC from INSERT

admin wrote:

Ok, I got this to work. I didn't have to do anything to ViEmu, just follow the following steps:

  1) Download DevExpress's 'DXCore' from this address:

         http://www.devexpress.com/Downloads/NET/IDETools/DXCore/

  2) Install it. It will prompt you what to do, say 'Repair' (since you have a version of DXCore installed from your Refactor for C++ install)

Unfortunately this doesn't seem to work with Refactor Pro 3.0.5. This creates a proper DevExpress menu without problems. This is in VS2008.

I get a warning that the product is already installed and I need to uninstall it first - no Repair option. Removing and re-installing DXCore alone is possible, but makes no difference.

I went through the entire list and removed all referring to ESC, no luck. Still won't let me exit insert mode. sad

Mike

19

Re: Refactor! C++ and ESC from INSERT

Mike, have you verified that it's the fault of Refactor Pro? Also, please make sure you haven't left a single assignment involving Esc, as far as I remember, the DXCore keybinding config list was a bit confusing due to the collapsible command tree.

I'll try it out myself and post here too.

- Jon

20

Re: Refactor! C++ and ESC from INSERT

admin wrote:

Mike, have you verified that it's the fault of Refactor Pro? Also, please make sure you haven't left a single assignment involving Esc, as far as I remember, the DXCore keybinding config list was a bit confusing due to the collapsible command tree.

I'll try it out myself and post here too.

- Jon

You were right, Jon... I thought I had 'em all, but nope, yet one other sub-tab that I'd overlooked had another one creeping in.

Removed it, all good now!

Cheers
Mike

21

Re: Refactor! C++ and ESC from INSERT

Great to hear that, thanks!!

22

Re: Refactor! C++ and ESC from INSERT

If you don't have a DevExpress menu item in Visual studio you can get to the DevExpress Options menu by hitting Ctrl-Shift-Alt-O.
This should work without installing or repairing DxCore.

23

Re: Refactor! C++ and ESC from INSERT

Thanks mphafner for the heads up!

  -- Jon