Bug 16630 - CTRL + ALT (AltGr?) modifier keys randomly fire, only when VS.iOS plugin is loaded
Summary: CTRL + ALT (AltGr?) modifier keys randomly fire, only when VS.iOS plugin is l...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 1.12.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-05 18:29 UTC by Andy
Modified: 2017-02-24 18:25 UTC (History)
9 users (show)

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


Attachments
Test project - default project basically (26.40 KB, application/octet-stream)
2013-12-10 12:22 UTC, Andy
Details
log for devenv (197.52 KB, text/xml)
2013-12-20 08:17 UTC, Andy
Details
Tools installed (32.00 KB, image/png)
2014-01-06 13:48 UTC, Andy
Details


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 on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Andy 2013-12-05 18:29:28 UTC
I'm not sure how this can happen, in fact I tried to pin it down to anything less possible which could be related, but to no avail. 

While editing code in VS, maybe typing fast, somehow, now and then, ctrl+alt gets "activated" and modifies the key I'm pressing. This happens randomly sometimes not very often, then progressively more, to the point of happening every minute or so. 

Like I said, I was hesitant to pin it to xamarin, but this is what I tried:

-replaced keyboard
-disconnect mouse
-close/kill/uninstall all programs that could mess with keys (hooks,etc)

Nothing would change...

So, thinking it was VS, I tried to go back working on a windows project residing on the PC. 
This time I had no problems, the issue never presented itself during a long test.

Closed the solution, reopened the iOS one, sure enough the problem appears again. 

Now, I'm still a bit hesitant to blame the VS plugin for this, but I'm asking you anyway because I'm at my wits end and I couldn't possibly see any other correlation.
Comment 1 Andy 2013-12-06 11:32:46 UTC
Ok, I'm still thinking there's something weird, but I once again did all the possible tests, and the only thing that activates/removes this behaviour is whether I'm editing a iOS/Xamarin project or not.
Comment 2 Andy 2013-12-08 16:27:52 UTC
Third day of heavy testing. I tried to move the projects again to different (local/remote) hd, now change. I tried many combinations, software, drivers, etc, no change.

Except this: when I have a xamarin (VS.iOS) project open, the issue happens. 
With other projects, it doesn't.

I think I'm almost sure that it activates 'AltGr', which equates to Ctrl+Alt, as a modifier for the next key. Like it's being depressed and released after I press something. The most common case is while I'm moving with the keyboard arrows.

Pressing just "arrow up" results in Ctrl+Alt + Up and goes to the navigation bar

Right now I'm pretty sure it's VS.iOS. And it's making editing code impossible on VS. So right now I have two broken editors ! (XS is impossible to use for auto-formatting, auto-indentation, etc)
Comment 3 Marek Habersack 2013-12-10 12:06:19 UTC
Andy,

We would need to have the following from you:

 - list of all installed VS extensions, with versions
 - sample solution where you can repro it

The Xamarin extensions do not extend, modify or otherwise affect the VS text editor or keyboard mappins, so we have no starting point to investigate this issue.
Comment 4 Andy 2013-12-10 12:20:06 UTC
Marek,

I'm aware of that, in fact that's why I hesitated so long to file this as your bug. But all clues point to that.

List of vs extension: none besides xamarin. I had VMware debugger, but removed it long ago

Sample project: I'll send it in a minute, but I tried with a simple HelloWorld project and it happened there too...

If I may suggest something, it looks like there's some trigger that fires some command...which enables Ctrl-alt. 
as I said, this could both be caused by something in your tools directly or indirectly, what I'm sure is that it happens only with the plugin loaded
Comment 5 Andy 2013-12-10 12:22:04 UTC
Created attachment 5627 [details]
Test project - default project basically

As I said, this is a basically empty default project.
Comment 6 Andy 2013-12-10 12:23:32 UTC
By the way, title is now incorrect. I am almost certain the only key that gets fired is CTRL+ALT, which applies to the next key you press. Then you can type normally again for a while.

I also looked far and wide for VS forums for similar problems to no avail.

And it doesn't happen in other programs/editors
Comment 7 Andy 2013-12-10 12:26:51 UTC
Sorry let me be more precise. List of installed tools:

Mono Tools for VS
Xamarin Shell
Xamarin.iOS
Comment 8 Marek Habersack 2013-12-11 07:05:09 UTC
One other question - what are your Windows and VS locales?
Comment 9 Andy 2013-12-11 07:59:47 UTC
Windows locale is it-IT
I guess VS locale is the same ?
Comment 10 Andy 2013-12-15 17:37:22 UTC
Ok, after a few more days, even if it still looks weird,I'm more and more convinced it's xamarin fault,

- happens only on VS
- doesn't happen on normal c# projects, I've been trying for two days without a single issue
- seems very random and not triggered by me in any way. Like something in the background is doing some process now and then, which triggers the modifier keys
- it still happens even if I basically kill every program, other than vs
- it happens even if the iOS project is local
- it still happens even after uninstalling drivers and software which might have hooks

I repeat, I know it sounds weird, but I really couldn't find any other explanation.
Comment 11 Marek Habersack 2013-12-17 05:06:26 UTC
Andy,

We need to know more about your environment, alas. Could you please let us answers to those questions:

 - exact Windows version
 - keyboard layout you are using
 - Mono Tools for VS version
 - please provide ActivityReport.xml which is produced if you run VS from 
   command line like this:

      devenv /log
 - can you get the smallest solution prepared for us in which you are able to 
   repro the issue? 
 - does the issue still happen if you remove Mono Tools for VS? 
 - does it happen if you change your VS locale to English
 - does it happen if you change your keyboard layout to, say, standard American 
   or International?

Thanks!
Comment 12 Andy 2013-12-17 05:13:10 UTC
Not in front of computer at the moment. But

 - exact Windows version
Windows 7 x64 ultimate fully updated
 - keyboard layout you are using
It-IT
 - Mono Tools for VS version
1.82 maybe 
 - please provide ActivityReport.xml which is produced if you run VS from 
   command line like this:


      devenv /log
Will do 
 - can you get the smallest solution prepared for us in which you are able to 
   repro the issue? 
Empty solution will do, with any cs file
 - does the issue still happen if you remove Mono Tools for VS? 
Haven't tried, will do
 - does it happen if you change your VS locale to English
Will try
 - does it happen if you change your keyboard layout to, say, standard American 
   or International?
Will try

Nice suggestions thanks
Comment 13 Andy 2013-12-20 08:16:58 UTC
I'm going to do the tests you suggested, in the meanwhile...

 - exact Windows version
Windows 7 Ultimate SP1

 - keyboard layout you are using
it-IT
(Italian-Italy)

 - Mono Tools for VS version
I now switched to latest beta:
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.5.50938 SP1Rel

Mono Tools for Visual Studio   2.0.8152
Mono Tools for Visual Studio provides developers with features which improve the development experience for targeting the Mono runtime.

Xamarin.iOS   1.10.30 (4379d2c4)
Visual Studio extension to enable development for Xamarin.iOS


 - please provide ActivityReport.xml which is produced if you run VS from 
   command line like this:

      devenv /log

Uploading

 - can you get the smallest solution prepared for us in which you are able to 
   repro the issue? 

Do you want me to upload it ? I just create an empty universal project and work on any .cs

 - does the issue still happen if you remove Mono Tools for VS? 



 - does it happen if you change your VS locale to English


 - does it happen if you change your keyboard layout to, say, standard American 
   or International?
Comment 14 Andy 2013-12-20 08:17:42 UTC
Created attachment 5704 [details]
log for devenv
Comment 15 Andy 2013-12-20 08:28:26 UTC
By the way, the only setting I find in VS, is Language: English / Same as Windows.
Since both VS and Windows are English, I can't change much.
Comment 16 Andy 2013-12-20 12:34:27 UTC
 - does the issue still happen if you remove Mono Tools for VS? 

If I remove them, the projects won't load and stay at '(loading)' in the solution explorer.

Any other suggestions ?
Comment 17 Andy 2013-12-20 13:04:03 UTC
Tried with or without Build Host connection. No change
Comment 18 Andy 2013-12-21 14:33:49 UTC
 - does it happen if you change your keyboard layout to, say, standard American 
   or International?

Yes, it still happens. 

I think I did all the tests you indicated, the only thing that I can't test is uninstalling Mono / Xamarin, that way projects won't load
Comment 19 Andy 2013-12-24 10:40:22 UTC
I've done one more test, I've loaded in parallel in two VS instances:

1) the entire Xamarin.iOS solution
2) a few of the same files from the above solution, without solution, loaded individually

Editing on 1) produced the keystroke
Editing on 2) didn't produce it

At this point at least I would say Monotouch/Xamarin.iOS is doing something weird that triggers the problem.
Comment 20 Andy 2013-12-26 12:12:59 UTC
I tried to install an old Xamarin.iOS version from your website, but it's impossible, it says xamarin shell isn't the right version... !!
Comment 21 Andy 2013-12-26 14:10:41 UTC
After a lot of pain (as usual) I managed to install 1.8.360.0 and the problem remains. The older version (1.4.2.0) won't load the updated project, so after losing a lot of time even to find out how to downgrade (see other bug), I'm giving up. 

I gave you all the info requested and more, haven't heard from you in a while...can I get an update ? I can't work like this !!!
Comment 22 Miguel de Icaza [MSFT] 2014-01-05 10:43:05 UTC
Reopening
Comment 23 Andy 2014-01-05 16:18:53 UTC
Thanks. If anybody is interested in following this, I have a way to test it whether it happens or not easily now, after weeks of trial and error.

Open a very long cs file and start scrolling up and down with the arrows. Eventually, you'll end up in the Navigation bar, just like pressing CTRL+ALT+ARROW UP or in the file list. Most of the times, it happens (I don't know why) in the nav bar, might just be chance.
Comment 24 Miguel de Icaza [MSFT] 2014-01-06 13:24:14 UTC
I noticed the mention of the word "Mono Tools for VS"

Is this the old Novell-era add-in for developing Linux apps from VS?

Because Xamarin does not provide support for that tool.
Comment 25 Andy 2014-01-06 13:44:57 UTC
I don't understand. I only installed the latest stuff from your website and installer. 

If those tools are still there or have that name, I don't know how/why
Comment 26 Andy 2014-01-06 13:48:45 UTC
Created attachment 5765 [details]
Tools installed

So what happens with these ? Should I uninstall them ? What do they do ?

Also, since I bought them from you, who should provide support ?
Comment 27 Miguel de Icaza [MSFT] 2014-01-06 14:58:02 UTC
We are perplexed, that is a very old product, from the Novell days, not sure how you ended up having that installed on your system.

But if you have a menu with "Mono" on it, that is not a Xamarin product.
Comment 28 Miguel de Icaza [MSFT] 2014-01-06 15:10:19 UTC
Andy, we never sold "Mono Tools for Visual Studio", that is a product that only Novell sold, and has not been sold since 2011.

Its purpose is to debug .NET apps running on Linux servers.
Comment 29 Andy 2014-01-06 15:16:18 UTC
Ah, you tell me !! :)
I assumed it's your stuff !

I only ever installed stuff with your installer(s) and reinstalled VS a while ago - I can tell you that I always has that menu right after installing it. 

But anyway...can I uninstall it ?
Comment 30 Andy 2014-01-06 15:28:13 UTC
(After installing it = after installing your stuff )
Comment 31 Marek Habersack 2014-01-07 06:23:57 UTC
Andy,

None of Xamarin installers install Mono Tools for Visual Studio, so you must have had them installed from another source.
Comment 32 Andy 2014-01-07 06:37:56 UTC
I don't know, are you sure ? Anyway, I disabled it for now. 

Also, I think I managed to mitigate the problem by:
- moving solution to local hard drive
- use vs2013

But it still happens at times
Comment 33 Marek Habersack 2014-01-07 08:51:35 UTC
(In reply to comment #32)
> I don't know, are you sure ? Anyway, I disabled it for now. 
Yes, I am quite sure.
 
> Also, I think I managed to mitigate the problem by:
> - moving solution to local hard drive
> - use vs2013
> 
> But it still happens at times
Another thought - do you have any accessibility options enabled in windows? What you describe sounds very much like "sticky keys" - an accessibility feature in many operating systems.
Comment 34 Andy 2014-01-07 09:28:19 UTC
It was one of the first thing I checked. Nope. Besides, why only in VS with xamarin loaded ?
Comment 35 Marek Habersack 2014-01-07 12:08:36 UTC
The extensions use MEF to hook to VS commands/install new ones - sometimes the effect of MEF are surprising, but there's certainly nothing obvious that stands out. This issue has several people puzzled.
Comment 36 Andy 2014-01-07 12:29:28 UTC
Ah, you tell me ! I was looking everywhere...

Besides  I was working with system hooks for years (more than a decade ago, luckily), but even that wouldn't explain  it very well. Why the triggering for example
Comment 37 Andy 2014-01-08 14:25:36 UTC
Since VS2013 now works with the plugin, I moved there and haven't had this issue anymore. 

I'm afraid that in VS 2010 it's still present
Comment 38 Andy 2014-01-29 11:41:12 UTC
Ok, update: after removing the old stuff about MT on VS 2010, at the same moment I moved to VS 2013. On VS 2013 the problem never appears.

I had to go back to VS 2010 for a moment and sure enough the problem is still there.
Comment 39 Andy 2014-01-30 13:39:07 UTC
Any clue why this happens on VS 2010 and not on VS 2013 ? 

Anything I can try to 'reset' as settings on VS 2010 ? 

Or are you doing something different on the two plugins ?

Can you please suggest something ? I still need VS 2010 at times for compatiblity reasons.
Comment 40 Andy 2014-05-07 09:04:00 UTC
After managing a few obscure workarounds, today the issue resurfaced with the new 1.12 VS plugin. It's making it impossible to work again

Windows 7 64 bit
VS 2010 ultimate
VS.iOS plugin v 1.12
Comment 41 Dominique Louis 2014-05-07 10:48:41 UTC
Hi Andy,
  To confirm, the the Ctrl+AltGr keys do not respond when the iOS plugin is loaded into VS2010?


D.
Comment 42 Andy 2014-05-07 10:51:31 UTC
Quite the opposite. 

Ctrl+ALT, which is the same as AltGr (not Ctrl+AltGr) is fired randomly ONLY when the iOS plugin is loaded and 'eats' the next key you press.

For example you're tapping up, up, up, up (or keeping up arrow pressed) and at a certain moment, it's like tapping Ctrl+Alt+up  which brings focus to the code navigation bar.
Comment 43 Andy 2014-05-07 11:48:39 UTC
Uninstalling the iOS plugin (and everything else xamarin, forcibly !) and reinstalling last 1.10 fixed the issue. 

But this leaves me without future updates.
Comment 44 Dominique Louis 2014-05-07 12:33:16 UTC
Andy are you using some kind of funky Key binding? Ctrl+Alt+Up for me changes my screen orientation, regardless of if I am in VS2010 or any other app on windows 7 64bit. I am using the latest stable 1.12 build here.

Note we don't make any changes to VS's keybinding in our add-in. We do add menus, but IIRC none of those are bound to any keys either.
Comment 45 Andy 2014-05-07 12:40:34 UTC
No, maybe your keybinding to Ctrl+Alt+Up is from the drivers of you graphics card ?

In no app that key binding works for me...

Besides I pretty much tried it in any possible way to exclude it wasn't Xamarin plugin. Check my previous comments, I really spent a long time debugging this behaviour...

The only hint was that Mono Tools had the same behaviour. That has been uninstalled a long time ago and the iOS plugin had the same issue depending on its version and VS version.
Comment 46 Andy 2014-05-09 10:07:20 UTC
Recap of emails:

- issue is that randomly it seems: either CTRL+ALT is fired and sticks until you type a key or that it simply eats your next key (which I suspect is because it fires CTRL+ALT). Sometimes up to one key in three, sometimes doesn't happen for ten minutes.

- new log doesn't show anything, I think. Should I attach it ? it's basically the same stuff again.

- VS 2013 seems to work ok (can't test it extensively)

- VS 2010 had the problem. Last time I tested it I could type one out of three keys. Impossible to work like this.

- uninstalling or disabling the iOS plugin solves the problem. Of course you can't load a Xamarin solution anymore.

- but in any case if you load any other project or single files, anywhere on the network, the problem goes away. So it's only when the plugin is loaded

- No other plugin loaded

- No hooks

- No peculiar drivers

- Only happens in VS 2010 and with Xamarin solutions. No other part of the system affected

- Working locally, no remote desktop, etc

- Mono Tools didn't make any change I think. I can't remember what kind of fixed the issue because I tried a lot of things. What I remember is that I uninstalled EVERYTHING and reinstalled it THREE times. At the third time I probably installed a different version of iOS plugin (latest 1.10) and this fixed the issue. My best guess.

- I have nothing peculiar setup on VS. I can try again resetting my keybindings, but I already did it in the previous tests. 

- waiting for input
Comment 48 Andy 2014-05-09 10:10:15 UTC
Also and this is crucial:

- V 1.10 works OK

- V 1.12 has this problem.

Tested reliably installing and uninstalling them three times

I pretty much did all the homework possible ... can you help ?
Comment 49 mag@xamarin.com 2016-12-22 20:31:30 UTC
I'm marking this issue as Resolved since it has been reported a long time ago and we have changed many iOS features from scratch, among a lot of improvements and fixes.
Given that it's a very weird bug and too hard to reproduce, I think it's better to mark it as Resolved and in case you still have this behaviour, you can re open it.

Thanks,
Mauro