1

Re: How to select from ContextMenuStrip without using the mouse?

Hi.  I'm a long time visual studio + visual assist user.  I've only recently started using vim at home for light coding on my macbook.  I found ViEmu and it seems like it can greatly improve my productivity at work plus help me towards my goal of never having to use the mouse.

I've been using the trial version for about a week now and it's mostly fit into my daily workflow.  One issue I do have though regards the "Goto Implementation" feature in Visual Assist (VAX).  Before ViEmu, I would move the cursor over a keyword and press Alt + G (which is mapped to to VAssistX.GotoImplementation ) to goto that keywords declaration.  If there were multiple possibilities, a ContextMenuStrip would pop up.  And I could either use the keyboard arrows or the mouse to select between them. 

However with ViEmu installed, the arrow keys no longer work.  Once I press Alt + G, the options pops up.  But then the focus goes back to the text editor.  The arrow keys or hjkl move the cursor in the text editor.  The only way to select an option from the popup is to use the mouse. 

Do other people encounter this issue?  Is there a solution that would enable me to use the keyboard to select an option?  I posted a screenshot to show the issue.

For reference, I'm using Visual Studio Professional 2005 SP1, Visual Assist X 10.4.1626.1 built 2008.01.17, and ViEmu 2.2.9.

Thanks in advance.  And thanks to the ViEmu author for a great product.  I will be purchasing a license soon.

EDIT: The screenshot doesn't show up clearly in the post.  Here is a direct link to the screenshot.  http://imgur.com/NJh0T.png

http://imgur.com/NJh0T.png

Last edited by dkgamez (2010-03-11 20:11:53)

2

Re: How to select from ContextMenuStrip without using the mouse?

Dkgamez, thanks for the kind comment and the detailed post. I will look into this, as ViEmu should be passing the arrow keys through for Visual Assist to process them.

Also applicable, JP Boodhoo has solved a related problem with Resharper, that is, not having to use the arrows at all. He uses the open source tool AutoHotKey. Here are the details:

  http://blog.jpboodhoo.com/VSViEmuReSharperModdedWithAutoHotkey.aspx

3

Re: How to select from ContextMenuStrip without using the mouse?

Hi.  Thanks for getting back to me.  I tried the AutoHotKey suggestion and mapped the up/down arrow keys but it still does not select any entry in the context menu.  Which makes sense because I can't use the normal arrow keys anyway since the context menu doesn't have focus.  However, once that problem is resolved, I can see AutoHotKey being useful - since it allows me to avoid moving my hands to the arrow keys.

4

Re: How to select from ContextMenuStrip without using the mouse?

Ok. Actually, the right fix would be the following:

1) In ViEmu, intercept the Alt-G command in some way
2) When the command is triggered, put ViEmu in internal "passthrough mode". This will basically ViEmu inactive, such that arrow keypresses can go to VAX.
3) Detect a RETURN or ESC or mouseclick in this mode, and exit passthrough mode.

The toughest part here is detecting the VA command. If they have used VS's command routing system, it's easy to intercept. If they are processing keypresses directly, or doing it in some other way, it could range anywhere from difficult to impossible.

It's good to get the full background now. I'm taking note of this, and I'll try to look at it as time permits.

Thanks,

  -- Jon

5

Re: How to select from ContextMenuStrip without using the mouse?

I used to have the same problem until the VAX folks updated their context menu with numerical shortcuts:
http://i.imgur.com/dO6Ox.png

While the up/down arrow keys still don't work, the numbers work. If you still have a maintenance license for VAX, you should upgrade.

Last edited by MHaggag (2010-04-01 20:53:34)

6

Re: How to select from ContextMenuStrip without using the mouse?

Mhaggag, thanks for your help. I hope to be able to look into this and other VAX/R# interaction issues in a few weeks now. I'll post here with the results. Regards, -- Jon