Visual Studio appears to randomly adopt American keyboard layout

断了今生、忘了曾经 提交于 2019-12-28 03:20:30

问题


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


回答1:


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?




回答2:


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



回答3:


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.




回答4:


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:




回答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"




回答6:


Windows 7

Remove all but one keyboard from:

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




回答7:


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.




回答8:


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.




回答9:


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).



来源:https://stackoverflow.com/questions/484248/visual-studio-appears-to-randomly-adopt-american-keyboard-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!