Helping others become Visual Studio Keyboard Ninja's with the Code Ninja Spy


Imagine you're a Visual Studio Keyboard Ninja. Your hands never leave it, you disdain the mouse and just let your fingers fly.

Now you're at the podium presenting, or paired with another, or giving a screencast, fingers flying as usual. Then the questions start flooding in... "How'd you do that?" "What made that happen?" "What shortcuts are you using?" "Where'd you learn that..." "What was that keyboard cord combination again?" etc. etc. etc.

Your train of thought is getting derailed, you're stumbling now, you are having the verbally repeat each action, your presentation is grinding to a halt and worse of all you realize you might not be imparting what you meant too, you're not building and sharing your hard won knowledge and experience with your audience.

If only there was some kind of keyboard shortcut visualizer. Something that visualized the keyboard shortcuts you're using so everyone can see what your hitting and follow along.

Something like...

Code Ninja Spy


This tool loads all Visual Studio shortcuts. When you press one, the key combination and the Visual Studio command will be displayed. So you can look over the shoulder of a skilled co-worker and learn from him the shortcuts he uses.

Start it via View -> Other Windows -> CodeNinjaSpy

The last 3 shortcuts are shown. If you have any suggestions, feature requests or find bugs, contact me via Twitter (@papaMufflon) or via GitHub, where this piece of software is available also (

So not only only is this cool, but this wouldn't be a Coding4Fun blog post unless there was some code to share... 

The source for this tool is fully available for you to check out.

Here's a snap of the Solution:



And a quick code snip;

private static string ConvertToKeyBinding(List<List<Keys>> keyCombinations)
      var keyBinding = "";

      foreach (var pressedKeysParameter in keyCombinations)
        var pressedKeys = pressedKeysParameter.Select(k => k); // just copy
        var singleKeyBinding = "";

        // first ctrl
        if (pressedKeys.Any(IsControlKey))
          singleKeyBinding = "ctrl+";
          pressedKeys = pressedKeys.Where(k => !IsControlKey(k));

        // then shift
        if (pressedKeys.Any(IsShiftKey))
          singleKeyBinding += "shift+";
          pressedKeys = pressedKeys.Where(k => !IsShiftKey(k));

        // then alt
        if (pressedKeys.Any(IsAltKey))
          singleKeyBinding += "alt+";
          pressedKeys = pressedKeys.Where(k => !IsAltKey(k));

        singleKeyBinding = pressedKeys.Aggregate(singleKeyBinding, (current, pressedKey) => current + (KeyToString(pressedKey) + "+"));
        singleKeyBinding = singleKeyBinding.Substring(0, singleKeyBinding.Length - 1);

        keyBinding += singleKeyBinding + ", ";

      return keyBinding.Substring(0, keyBinding.Length - 2);

If you're looking to extend your knowledge of building Visual Studio Extensions or the keyboard command knowledge of others, this is a project you might want to check out...

The Discussion

  • User profile image

    When I'm trying to load project, it says "The project type is not supported by this installation." I have visual studio 2010. Do I need to install some additional extras to VS?

  • User profile image

    Sorry about that... Due to all my blogging and projects I look at I have just about everything installed.

    Yes, you'll need the Visual Studio 2010 SDK installed (And be using VS Pro or better)

    Background: Each project contains a number of "Project types" that it needs. When you get that error it means VS can't find one or more of these types.

    Here's the type's from this project (in the CSProg file)


    And the first one is:

    Extensibility Project

    So you'll need the Visual Studio 2010 SDK ( or Visual Studio 2010 SP1 SDK ( and since that requires VS Professional...

    Hope this helps.

  • User profile image

    Thank you, it works now.
    I have VS2010 Professional, because I am student and we got it at school.
    But it didn't work with VS 2010 without SP1. Without SP1 all commands were loaded, but when I tried some shortcut nothing happen, just blank screen. With SP1 it works fine. So now can I study the code :) Thanks again for help.

  • User profile image

    I always tell people that the mouse is the keyboard for morons.

  • User profile image

    I want something that kind of does the opposite. When I do something that has a shortcut equivalent then show that. So that I can hopefully remember and use it the next time.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.