Change Keyboard Mappings on Field Focus

Lightwave

Ad astra
Local time
Today, 15:21
Joined
Sep 27, 2004
Messages
1,537
Right I have Windows 7 Ultimate because I am learning Russian and I have created an English Russian dictionary.

Now using Ultimate to go between English Latin alphabet and the Cyrillic alphabet you have to press ALT + SHIFT.

Its awkward and it often doesn't register first time.

Certain fields in my database use the latin alphabet while other fields use the cyrillic alphabet.

Is there a way that on focus of a field I can get the keyboard mapping to ensure that it is correct either English or Cyrillics?
 
I have a bit of code i came across once upon a time. Never tried it but bits of code ALWAYS come in handy :) I think that is the ID for the Russian language.

Code:
Private Declare Function ActivateKeyboardLayout Lib "user32.dll" (ByVal myLanguage As Long, Flag As Boolean) As Long 'define your desired keyboardlanguage

Private Const RSN = 1049 'russian keyboard language layout

Private Const eng = 1033 'english(united states)keyboard language layout

Private Sub A_GotFocus()

Call ActivateKeyboardLayout(RSN, 0)

End Sub

Private Sub A_LostFocus()

Call ActivateKeyboardLayout(eng, 0)

End Sub
 
Excellent I will try it out
 
Thank you, Isskint !
May I ask you from where I can catch the values for other languages ?
(I am from Romania :) )
 

Users who are viewing this thread

Back
Top Bottom