Simple solution for "Cannot set Keyboard Shortcuts" Problem (for Intellij)

The "Cannot set Keyboard Shortcuts" Messagebox and the deleting of all Shortcuts on every Resharper update should be fixed if you want to sell Resharper to People with non Englisch Visual Studio Versions.

Your Problem is Definitly that you try to set keyboard Shortcuts for the "Text Editor" by the Englisch String, this causes an exception on every NON English Visual Studio.

To fix this problem you must simply translate the keyboard shortcut definitions before calling

command.Bindings="Text Editor::Alt+x"

The translatet string for "Global" Keyboard settings you can find in the Resource DLL "msenvui.dll" in The Stringtable as the String with the ID 13018.

For Text-Editor only shortcuts you must use the String with ID 13022.

To Read the string resources you can Look at the MSDN documentation.

msenvui.dll you can find at
\]]>\msenvui.dll

To locate the file "msenvui.dll" with the correct language you will need to reed 2 registry settings.

The Installation Path of Visual Studio, and the Currently Selected Language

you can find the needed registry values here (as string)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir

and here (as dword, must be formattet as decimal in the path of the file)

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\General\UiLanguage

i hope this will help you to fix this problen witch exists since the beginning of the EAP

5 comments
Comment actions Permalink

oops, many typing errors at dead of night, but readable anyway i hope ;)

0
Comment actions Permalink

Hello Carsten,

thank you a lot for this information. Unfortunately, I don't think that we'll implement this approach, because you have to agree that it looks a bit like a hack.
It's odd that MS have not provided any programmatic means for accessing locale-invariant identifiers of string resources. But taking the situation as is,
we can hardly circumvent this problem with reasonable effort, since I believe that not only shortcut scope names (like 'Globals' and 'Text Editor') but also
key names themselves (as far as I know 'Ctrl' is named 'Strg' on German keyboard) are localized.

Anyway, thank you again for your investigation. Personally, I'm quite impressed by the work you've done to discover the root of the problem.

--
Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

The "Cannot set Keyboard Shortcuts" Messagebox and the deleting of all
Shortcuts on every Resharper update should be fixed if you want to
sell Resharper to People with non Englisch Visual Studio Versions.

Your Problem is Definitly that you try to set keyboard Shortcuts for
the "Text Editor" by the Englisch String, this causes an exception on
every NON English Visual Studio.

To fix this problem you must simply translate the keyboard shortcut
definitions before calling

command.Bindings="Text Editor::Alt+x"

The translatet string for "Global" Keyboard settings you can find in
the Resource DLL "msenvui.dll" in The Stringtable as the String with
the ID 13018.

For Text-Editor only shortcuts you must use the String with ID 13022.

To Read the string resources you can Look at the MSDN documentation.

msenvui.dll you can find at
<visual studio install path>\<current languade id>\msenvui.dll
To locate the file "msenvui.dll" with the correct language you will
need to reed 2 registry settings.

The Installation Path of Visual Studio, and the Currently Selected
Language

you can find the needed registry values here (as string)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\InstallDir

and here (as dword, must be formattet as decimal in the path of the
file)

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\General\UiLangua
ge

i hope this will help you to fix this problen witch exists since the
beginning of the EAP


0
Comment actions Permalink

if you don't implement this, you shoult at least fix your very old old bug that you delete all keyboard shortcuts on non englisch visual studio on every resharper update.

there are several ways to solve this.

you can save existing keybindings and reset them to the previous value if an exception occurs instead

it is very frustrating to set all keybindings by hand on every new resharper build.

an other fis would be to make the words "Global" and "Text Editor" configurable in your settings

0
Comment actions Permalink

localized names for CTRL/STRG are not a problem, in my tests it seems that englisch names will be accepted on all systems independent of the system language or visual studio language

0
Comment actions Permalink

Carsten,

the problem is that ReSharper deletes all its commands when you uninstall it (in particular, during
update), since otherwise invoking these commands with no ReSharper installed would cause an error message box to appear in VS.
This behavior is by design but I agree that ReSharper could be smarter and do not reinstall shorcuts during update.

However, as far as I know there is a relatively simple workaround to your problem: just make a backup copy of the *.vsk file
with keyboard mapping scheme (normally located at "C:\Documents and Settings\<user-name>\Application Data\Microsoft\VisualStudio\7.1\")
before upgrading to a newer ReSharper build. After upgrade restore the *.vsk file from this backup. This will restore your shortcuts.

--
Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

if you don't implement this, you shoult at least fix your very old old
bug that you delete all keyboard shortcuts on non englisch visual
studio on every resharper update.

there are several ways to solve this.

you can save existing keybindings and reset them to the previous value
if an exception occurs instead

it is very frustrating to set all keybindings by hand on every new
resharper build.

an other fis would be to make the words "Global" and "Text Editor"
configurable in your settings


0

Please sign in to leave a comment.