Context menus VS2010 / 2012 and keyboard

    As a developer, I spend a lot of time in Visual Studio. And, I must say that most of the time Visual Studio is fine with me. But sometimes there are not very pleasant moments. One of these problems, which has been bothering me for a long time, is that context menus work a bit differently in VS2010 than in VS2005 / 2008. And in VS2012, this situation has not changed.

    So what are these differences? It so happened that when working in Visual Studio, I mainly use the keyboard. And I also open context menus in the code editor from the keyboard - using the corresponding key (Apps key). In addition, I have long been accustomed to using some kind of keyboard patterns, and I use them without thinking.

    In VS2008, the position of the mouse cursor did not affect keyboard navigation on the context menu. And I was sure that successive pressing of the “Apps, Down, Down, Enter, Up, Enter” keys would always call the “Organize Usings> Remove and Sort” function :

    image

    But in VS2010 this behavior has changed! If the mouse cursor is located above the opened context menu, then the item over which it turned out immediately becomes active. Accordingly, the sequence “Apps, Down, Down, Enter, Up, Enter” does not always lead to the desired result.

    And sometimes the result may not be very pleasant. When using Visual SVN in some cases, the above sequence of keystrokes can cause the function "Revert whole file"!

    image

    This is not fatal, the Undo function restores all changes, but this behavior of Visual Studio is very annoying.

    In Visual Studio 2012, context menus behave a little differently, but the essence remains the same - the position of the mouse cursor still affects their work, and this behavior still interferes with work.

    I tried to find out whether it is possible to somehow change this behavior of Visual Studio, but could not quickly find a solution. Then I went ahead and wrote a small utility that fixes this problem. This utility tracks the pressing of the Apps key, and if this key is pressed in Visual Studio, it simply moves the mouse cursor to the upper border of the screen before the context menu is opened.

    The compiled version and source code can be found here:

    http://code.google.com/p/vs-ctx-menu-fix/downloads/list

    The utility works on Windows 7 and Windows 8 x64. I wrote the first version in January 2011, now I just updated it to work with Visual Studio 2012.

    I hope that this utility will be useful not only to me! :)

    Also popular now: