0

I'm trying to get current keyboard language name in background. I used InputLanguage.CurrentInputLanguage.Culture.Name but I understood that this code doesn't work when application isn't focused. I mean it can't detect language changes when app isn't focused and it always returns the last focused language.

So what can I do to detect current language in background? I'm using windows forms for my application.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
YektaDev
  • 438
  • 3
  • 11
  • 24

1 Answers1

0

Refer to this answer to achieve what you want.

Detect current keyboard language/layout name in multi-language computer

Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName in the namespace System.Threading

Monir Tarabishi
  • 716
  • 1
  • 16
  • 30
  • Doesn't work! My keyboard has two languages, 'fa' and 'en'. I tried this code in a message box and it always shows me 'fa' with both languages. – YektaDev Mar 26 '18 at 08:09