2

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?

Adam Lear
  • 31,939
  • 8
  • 101
  • 125
  • 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 06 '11 at 11:07
  • @maple_shaft yes we do listen to some of the key strokes, let me have a look. Thank you – Prashant Cholachagudda Sep 06 '11 at 11:43

3 Answers3

4

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.

Jose Faeti
  • 2,815
  • 2
  • 23
  • 30
1

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.

0

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.

Rei Miyasaka
  • 4,541
  • 1
  • 32
  • 36