Windows 7 Change Context Menu Hotkey

2

I'm looking for a way to change the hotkey letters in the Windows 7 right-click context menu. I've added a new entry into my registry, "Edit with Vim" and the default hotkey is E. This conflicts with the "Edit" option which also has a hotkey of E, so I'd like to modify the registry in order to set the "Edit with Vim" option with a hotkey of V instead.

Can anyone help guide me in modifying the registry? Thanks.

raphnguyen

Posted 2012-12-26T18:10:57.287

Reputation:

Answers

2

Assume you add "Edit with Vim" command to the context menu of .txt file. This extension is usually associated with txtfile key. The commands are listed in the shell subkey. The default value of the command key is the name of the command displayed in the context menu. If you add & before any of the characters, then the following character becomes the keyboard accelerator.

Let me explain using an example.

HKEY_CLASSES_ROOT
    .txt
        (Default) = txtfile

    txtfile
        shell
            EditInVim
                (Default) = Edit with Vim

In this case, the command Edit with Vim would not have an accelerator key. Change the value to Edit with &Vim, and then V would be underlined and pressing it will invoke the command.

If your editor uses a context menu handler to add the item to the context menu, then the only way to change the accelerator key is to edit the string resources in its executable file.


I didn't answer the original question though.

The default Edit command for text files comes from the following registry keys:

HKEY_CLASSES_ROOT
    SystemFileAssociations
        text
            shell
                edit
                    (Default) = (value not set)

The shell make the first letter the accelerator. To change it, assign the value to (Default):

                    (Default) = E&dit

The accelerator for Edit command has changed to d now.

Alexey Ivanov

Posted 2012-12-26T18:10:57.287

Reputation: 3 900