Bug 17050 - Hotkeys do not work unless the first hotkey is pressed under English keyboard layout
Summary: Hotkeys do not work unless the first hotkey is pressed under English keyboard...
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Shell ()
Version: 4.2.x
Hardware: PC Windows
: Normal normal
Target Milestone: master
Assignee: Cody Russell
URL:
: 31949 39943 42975 ()
Depends on:
Blocks:
 
Reported: 2014-01-04 01:40 UTC by gserg.g
Modified: 2017-02-20 23:07 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 17050 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description gserg.g 2014-01-04 01:40:17 UTC
Possibly related to bug 5162 https://bugzilla.xamarin.com/show_bug.cgi?id=5162

The common hotkeys, Ctrl+Z, Ctrl+X, Ctrl+C, Ctrl+V, do not work anywhere in the Studio (code editor, text fields in the dialog boxes etc) if the first of these hotkeys occurred when Russian keyboard layout was active.
In this state, if you go to the key mapper dialog in the Studio settings, the dialog sees the keys you press as numbers (e.g. you press Ctrl+X, the dialog displays 'Control+1057').

But if the English keyboard layout is active when the first hotkey press occurs, then the hotkeys work properly regardless of whether or not you later switch between layouts. In this state, the mapper dialog sees the keys you press properly (e.g. you press Ctrl+X, the dialog displays 'Control+X').

To reproduce:
- Launch a fresh instance of the Studio. Be sure to not press any hotkeys, only use mouse.
- Make sure the keyboard layout is ru-ru.
- Open code editor and press e.g. Ctrl+X to cut a piece of code.
- Observe nothing happened, and won't start happening even if you switch the keyboard to en-us.

To fix:
- Close the buggy instance.
- Launch a fresh instance. Be sure to not press any hotkeys, only use mouse.
- Make sure the keyboard layout is en-us.
- Open code editor and press e.g. Ctrl+X to cut a piece of code.
- Observe the hotkey worked, and everything keeps working when you switch the keyboard to ru-ru.

Using Xamarin Studio 4.2.2 on Windows 7 x64 (also GTK# for .NET 2.12.22).
Windows language is Russian.
Installed keyboard layouts: en-us, ru-ru. Ru-ru is default.

Original forum discussion: http://forums.xamarin.com/discussion/11881/keyboard-shortcuts-stopped-working-properly-in-the-code-editor
Comment 1 Mohit Kheterpal 2014-01-13 07:25:09 UTC

*** This bug has been marked as a duplicate of bug 5162 ***
Comment 2 Mikayla Hutchinson [MSFT] 2014-01-13 15:23:23 UTC
This is not a duplicate of bug 5162. Bug 5162 is that English keyboard shortcuts do not work when using non-English layouts.

This bug is that keyboard shortcuts do not work when using a layout other than the one that what set when XS was started.
Comment 3 Cody Russell 2015-07-14 16:44:21 UTC
*** Bug 31949 has been marked as a duplicate of this bug. ***
Comment 4 Mikayla Hutchinson [MSFT] 2015-07-14 17:26:16 UTC
It seems to be that there are two issues here:

1) The key mappings are not being updated when the keyboard layouts are switched. It looks like maybe our cached map of hardware keycodes to keyboard shortcuts isn't being correctly updated when the GTK keymaps changes. Maybe GTK isn't firing the state-changed signal?

2) Secondly, when keyboard shortcuts aren't resolved on a non-US english layout we could fall back to resolving the same keycode against a US layout. This would mean that e.g. Ctrl-X would work when using ru-ru layout as long as the user hasn't assigned another shortcut to the ru-ru interpretation of the same key. This is not trivial unfortunately as GTK doesn't have a way to look up arbitrary keymaps.

https://github.com/mono/monodevelop/blob/master/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs#L560
Comment 5 Cody Russell 2016-11-22 20:39:50 UTC
*** Bug 42975 has been marked as a duplicate of this bug. ***
Comment 6 Cody Russell 2017-02-20 23:07:51 UTC
*** Bug 39943 has been marked as a duplicate of this bug. ***