17

I'm trying to map View.NavigateBackward and View.NavigateBackward like so:

  • View.NavigateBackward = Alt + LeftArrow
  • View.NavigateForward = Alt + RightArrow

Pretty simple to do in Visual Studio with the Keyboard Options dialog. OK so I've assigned the shortcuts and the NavigateBackward one is working. But NavigateForward, which used to be assigned to Edit.CompleteWord, is staying with its old assignment. I've checked that Edit.CompleteWord is assigned to 'Ctrl+K, W' but the Alt+RightArrow is still behaving as complete word. Is there something special about the arrow keys that I can't assign them?

I want to do this so the mouse buttons behave the same in VS 2010 and my web browser. Works fine for the back button, but the forward button won't re-assign properly. Suggestions?

2 Answers 2

20

To expand on jcollum's answer...

Apparently, assigning at the global level does not mean "take effect globally". It appears instead it is a "fallback" when there is no more-specific assignment for the current editor type or window.

So, if you're not getting the global key assignment to behave, in this case Alt+Right Arrow, go to Tools-Options, Environment, Keyboard.

Click in the "Press shortcut keys" field, and press the Alt+Right Arrow combination.

Then click the "Shortcut current used by" drop down, and you'll see the offending command that is taking precedence, like "Edit.CompleteWord (Alt+Right Arrow (Workflow Designer))"

Keyboard screen1

Next, type the offending command into the "Show commands containing" field. i.e. type Edit.CompleteWord. Now click the "Shortcuts for selected command" drop down. Select the one that is overriding Alt+Right Arrow, then click Remove.

keyboard screen2

Now, your global assigned shortcut will be used (assuming there aren't other shortcuts taking precedence).

1
  • Thanks. That did it
    – kuklei
    Mar 17 at 16:13
6

Classic "figured it out 30 seconds after I posted": you have to remove the Edit.CompleteWord keyboard assignments in all editors -- even though Alt + Right Arrow was assigned in Global as View.NavigateForward. Apparently Global doesn't override all editors like it should.

1
  • Thanks, I was searching for that for the exact same reason.
    – blez
    Jun 12, 2013 at 13:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .