Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have in-house .NET application, which can be used across multiple languages. Lately we received a strange bug that is when our application is being used, user was unable to enter accent characters (Spanish, Win 7) in other applications (ex: MS Word or Notepad). Strange, huh!

Did anyone come across similar bug? If yes how did you solve that?

share|improve this question
I would check to make sure that you are using the appropriate locales and if so double check that the unicode mappings to the accented characters are not being consumed by an event listener on your application. – maple_shaft Sep 6 '11 at 11:07
@maple_shaft yes we do listen to some of the key strokes, let me have a look. Thank you – Prashant Sep 6 '11 at 11:43
up vote 4 down vote accepted

Yes, it's possible. Applications can listen for key-press events and do whatever they want.

It is also possible to remap the keyboard behavior in Windows, both for single applications and directly by the Windows registry. This may cause conflicts with other applications trying to type some special characters.

Finally, it's possible to change the currently used keyboard layout, and even if in theory every application should retain its own layout used, it's really common in windows to change it for some application and see it changed also for others.

share|improve this answer

One particular keystroke that might be helpful to check is the apostrophe (') keystroke through your event listeners. I'm pretty sure this what tells windows to toggle the accent for foreign languages.

share|improve this answer

You can use keyboard hooks to hijack the keyboard. I might start by looking for SetWindowsHookEx calls in your code. Maybe try running your program normally and Notepad as Administrator; keyboard hooks don't work with higher privilege processes, so that might narrow down the problem a little.

You can change keyboard layout within your code, but only by changing the registry, and it requires a restart before it works (or at least a logout, maybe) -- so I highly doubt that that's the culprit.

As Jose notes, the input layout may have also changed. Go into the Windows Region and Language settings and under Keyboards and Languages -> Change keyboards -> Language Bar, choose Floating On Desktop. Try changing around several applications to see if the input language is getting switched. If it is, you should turn off any keyboard layouts that you're not using (you probably won't need English), or hit left alt + shift whenever the language gets switched.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.