124

Gah! This is really causing me hassle today. Suddenly without warning '@' (at symbol) and '"' (double quote) are trading places on my keyboard but ONLY in Visual Studio 2008!

I can't seem to find anything in help or online to explain/remedy this. Is there some keyboard shortcut I am inadvertently executing?

I rebooted my PC and it went away for an hour or two and then suddenly came back.

Oh, the insanity :(

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
hollystyles
  • 4,979
  • 2
  • 36
  • 38
  • 1
    every now and then mine switches to fr-ca - oh sweet mystery of life! – annakata Jan 27 '09 at 17:05
  • I get this in Eclipse on Windows XP. – JeeBee Jan 27 '09 at 17:06
  • I get this on My office Windows XP, it switches from SwissGerman to US every now and then .. the reason is a fat-fingering of and the space key (maybe shift, not always repeatable) ... the only known cure is to manualy set it back .. – lexu Jan 27 '09 at 17:10
  • I had a similar issue wish I described on http://stackoverflow.com/questions/5951960/ctrlspace-changes-keyboard-instead-of-showing-intellisenses-auto-complete-list , but it happened when I was typing Ctrl+Space – sergiol May 12 '11 at 16:48
  • I have the opposite problem - I have British English as my language, but use US keyboards out of preference. And somehow, while using Visual Studio, it occasionally switches the keyboard layout to UK. But the shortcuts to change languages are Win+Space which I am not pressing accidentally. – Jack Deeth Sep 19 '22 at 14:32

10 Answers10

230

I have tried the same thing, but it turned out to be because I was hitting Alt+Shift in certain programs, thus triggering the language switch in Windows.

Could it be that you accidentally hit Alt+Shift or Ctrl+Shift (British layout) when coding?

mookid8000
  • 18,258
  • 2
  • 39
  • 63
  • 4
    Was about to post the same. It's very likely Alt+Shift when the input locale changes mysteriously. – OregonGhost Jan 27 '09 at 17:08
  • 17
    same issue for me, only I switch from Dvorak to qwerty mid senyabj. – Chris Huang-Leaver Jan 27 '09 at 17:09
  • Thx! My issue was I had hit Ctrl-Shift which switched the keyboard layout. Be sure to use Ctrl-Shift do change back before you disable this "feature". – jsalwen Oct 11 '10 at 16:48
  • 2
    I had removed all keyboard input alternatives except the one I use, and still I was able to toggle between my setup and the US setup in Visual Studio only. Weird. Had to remove the shift+alt key binding to avoid this problem. – angularsen Jul 07 '11 at 18:25
  • Fixed my problems. Thank god for this nugget of info, it was driving me insane! FEATURE.... OF.... THE.... CENTURY . . . NOT! Because it makes complete sense to be able to toggle keyboard layout on your keyboard at the press of an (easily miss-keyed) key combination. That must be used legitimately by at least... maybe, ZERO people on the PLANET...... -- Sarcastic enough? – Rob Jul 18 '11 at 15:36
  • 1
    AAAAAAAAaaaaaaaaaargh!!!!! What numb-nuts came up with this? Alt+Shift+Tab moves to the previous task in the task switcher so I hit it loads. This was driving me nuts! –  Jan 26 '12 at 10:28
  • +1 and since I'm live in the UK with a US keyboard toggling between the two layout makes it much easier to type the £ much easier to type :D and I agree with @user159335 they could have used a better key combo. – TheLukeMcCarthy Aug 09 '12 at 14:57
  • Thaks a lot! I did ctrl+shift and the problem is gone (I suppose I did it without noticing in the first place) – Milo Jan 25 '13 at 10:11
  • Alt-shift and the problem is gone! And I'm never allowing my cat to get near the keyboard again. – Alex Dec 22 '13 at 01:33
  • 1
    Windows 10 has some of its keyboard settings moved into the new Settings app, but there's also an option in the old Region Settings to select a Region for apps that don't support Unicode. For me, this was set to English (UK) even though my only display language is English (Australia). – jimjamslam Jul 02 '18 at 04:11
  • To remove this ridiculous key bind in Windows 10 > Windows key > type 'advanced keyboard settings' > click 'input language hot keys' > unassign the key binds. – Andyweb Oct 17 '19 at 08:10
  • Thanks, you've saved my day! I accidentally pressed alt+shift when I've tried to press alt+shift+f for auto-formatting. – Zoldszemesostoros May 16 '20 at 18:42
87

This is Windows itself changing the keyboard layout - it's not really anything to do with Visual Studio, but it happens when you're using Visual Studio because the key combinations you use when tying in code are similar to the default key combinations Windows XP uses for switching keyboard layouts in the fly.

These instructions are for disabling keyboard layout switching in Windows XP. It's similar in other versions of Windows:-

  • Go into control panel and select Regional And Language Options.
  • Then on the Languages tab hit the Details button.
  • On the dialog that pops up, on the Settings tab, hit the Keyboard button at the bottom of it.
  • On the "Advanced Key Settings" box that pops up, select the other languages one by one and uncheck the key sequence options.
  • OK it all out and you're free from frustration :)
U62
  • 4,355
  • 1
  • 24
  • 37
  • That's fixed my Eclipse as well. It never really bothered me because I have a Mac at home and the @ and " are switched on that on their UK layout anyway. – JeeBee Jan 27 '09 at 18:36
  • 2
    Thanks for this. It was driving me insane. In Windows 7, you can unbind the shortcut that switches languages. My only language option is English (UK) and yet it switches between US & UK english in VS; unbinding the key fixes the problem. – Mark Simpson Aug 30 '09 at 21:41
  • I've definitely had an occasion where SQL Server Management Studio (based on Visual Studio) adopted US keyboard layout for no apparent reason but all other applications were on UK layout so this wasn't a global Windows settings for me. – Martin Smith Oct 12 '10 at 09:32
  • 1
    Not just XP!! Windows 7 as well (for me) – Paul C Feb 06 '13 at 20:53
  • I was having the same problem with SQL Server Management Studio for SQL Server 2012. I removed the extra keyboard layouts I had previously installed for testing purposes. The problem went away. Thank you! – Paul Williams Aug 19 '14 at 20:46
  • Disagree with your explanation. I don't even use the shortcuts in Visual Studio that changes the system locale. Just another sloppy Microsoft bug. But, this seems to "fix" the problem. – Chef Pharaoh Apr 01 '18 at 21:02
32

U62- Perhaps people don't mark your solution as an answer if it's not an answer for them?

It's not a CTRL+SHIFT or any other key binding problem for me.

I do not even have US-International keyboard installed, yet Visual Studio constantly reverts back to it (I can see it in the Language bar, but when I go into Control Panel, it is not in the list of installed keyboards).

It's definitely something wrong with Visual Studio, because if I then move to Notepad, Notepad knows that the keyboard is UK. Move back to VS2010 again and it is back on US International.

EDIT: the answer is to go into Visual Studio settings, and select the International Settings pane. Make sure the Language is set to "Same as Microsoft Windows". "English" seems to be the US International keyboard English.

Stephen Drew
  • 1,415
  • 19
  • 31
  • I've had the same thing where Management Studio goes to US layout and all other applications are on UK layout too. – Martin Smith Oct 12 '10 at 09:34
  • Thanks for the tip. However, you have to restart VS afterwards, which is incredibly annoying! Change the default setting randomly and then force me to restart VS. Well done VS, well done. – bileyazan Apr 14 '11 at 11:37
  • It seems to me this a Visual Studio 2010 issue. I don't remember this being happening in the 2008 version. The option you speak about is on menu Tools > Options > Enironnment > International Settings . It seems your solution has solved my problem; may be I am speaking too early about it. – sergiol May 09 '11 at 15:56
  • Damn that setting should be default – Paul C Feb 06 '13 at 20:54
  • 1
    This fixed it for me too, but I have to say, that it started right in that moment after I installed resharper. It never ever happened before. – Andreas H. Sep 15 '15 at 08:19
  • Thank you SO FRIGGIN MUCH. This was driving me absolutely up the wall, and there's no indication anywhere that it's happened. And I, too, only saw it when Resharper was installed. – RealityMonster Aug 02 '22 at 00:12
14

I posted this on another question, but wanted to post the picture here in case you're not using XP, and want to see how to accomplish this in Windows 7:

enter image description here

Community
  • 1
  • 1
Travis Heeter
  • 13,002
  • 13
  • 87
  • 129
  • 1
    Great post. I never went to this options in 20 years of windows use. Now I finally know why Windows change keyboard "mysteriously" – Eagle Apr 30 '15 at 09:40
5

I know this is quite late, but nobody actually said how you disable it.

In Windows 7, go to Regional Settings -> Keyboards and Layouts -> Change Keyboards -> Advanced Key Settings -> Hot keys for input languages.

Select the "Between input languages" and change the key sequence to "Not Assigned"

Marq
  • 51
  • 1
  • 1
4

Windows 7

Remove all but one keyboard from:

Control Panel >> Region And Language >> Keyboards and Languages >> Change Keyboards

enter image description here

Community
  • 1
  • 1
Contango
  • 76,540
  • 58
  • 260
  • 305
1

I ran into the same problem in Visual Studio 2010 Beta 1.

However, I learned that pressing CTRL + SHIFT toggles your keyboard between Qwerty to Dvorak.

This was extremely painful when I save all (CTRL + SHIFT + S) and accidentally release before hitting the 'S' until I figured out what was causing the issue.

Scott
  • 11,840
  • 6
  • 47
  • 54
1

Actually I can reproduce this following these steps. I suspect that it might have to do with the language culture of the compiled application. I have UK and US keyboard on the language bar.

I have built a simple C# Windows Forms application. I set the keyboard settings to US. I have a US keyboard although the rest of the regional settings on the machine are UK (The US version of the Micosoft keyboard I have has one less key than the UK version and it is a backslash, grr.) When I launch the application in the debugger the keyboard settings have miraculously changed back to the UK settings. This happens every time so it is not that another key is being pressed. I should also mention that this occurs in Windows Vista.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
developer
  • 59
  • 2
0

In XP if more than 1 keyboard input language is installed (ex: Dvorak and Qwerty) XP will flip flop randomly, particularly back to the OS's default language, and it mostly only happens when using a Microsoft application. And I'm 100% sure I'm not hitting Alt+Shift or any other key combination. This same problem will probably haunt you no matter what keyboard mappings or languages you have.

The only fix is to remove the secondary language and only add it when you need it. The other solution is to use Vista, which I notice no longer suffers from this bug (that's been in there since I started using Dvorak back in 2003 and not even XP SP3 fixed it either).

TravisO
  • 9,406
  • 4
  • 36
  • 44
0

To changeback to the language you want in VSC:
1- you have to press Ctrl+Alt+P,or Ctrl + Shift + P
try writting there 'display laguage', it shoulp autocomplete with the option'configure display language'
2- then in the display that will appear at the top, write the language you want in case it does not appear,
3- once this is done, VSC will ask you to restart.
4- once restart is done it should be fine.

It solves the issue for me the whole time

Joaquin86
  • 86
  • 9