views:

2638

answers:

6

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 :(

+19  A: 

I have tried the same thing, but it turned 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 when coding?

mookid8000
Was about to post the same. It's very likely Alt+Shift when the input locale changes mysteriously.
OregonGhost
same issue for me, only I switch from Dvorak to qwerty mid senyabj.
Chris Huang-Leaver
Fantastic - that's been bugging me for ages! Thanks.
gkrogers
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
+20  A: 

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
Excellent, thanks!
gkrogers
No problem. I'm glad at least one person bothered to try my solution. The OP just accepted someone else's repeating of the problem as the "answer". Oh well, that SO for you.
U62
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
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 unbinding the key fixes the problem.
Mark Simpson
You rock, U62, this is the Answer, what a royal pain in the ...
Brian
I wish it were possible to vote on accepting an alternative answer, as this is definitely the right one :)
brone
@Mark Simpson - My code thanks you. +1
Peter Bernier
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
A: 

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
+1  A: 

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
A: 

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.

developer
+2  A: 

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.

Steve
I've had the same thing where Management Studio goes to US layout and all other applications are on UK layout too.
Martin Smith