Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

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

image

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 (http://github.com/PapaMufflon/CodeNinjaSpy).

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:

image

SNAGHTML2db90473

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...

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.