Subject: | Re: Changing keyboard layout automatically
| Date: | 26 Feb 2023 18:22:31 -0400
| From: | "Linda" <linda.bye@ntebb.no>
| Newsgroups: | pnews.paradox-programming
|
Hi, aagin,
Yes the keybord change to "foreign" layout when entering the field for alternate
language text and change back to default when departing. I am using it in
a bilingual program for a hotel reception and restaurant.
I agree that using DLL's sometimes gives a general protection error and many
of them don't work at all (when using my "skills").
Linda
"Kevin Zawicki" <numberjack@wi.rr.com> wrote:
>
>
>
>Agree with Liz.
>
>But,
>
>> ; Field or record
>> method arrive(var eventInfo MoveEvent)
>> dodefault
>> LoadKeyboardLayoutA(ChangeKeyboard("TH"),1)
>
>Are you changing on the fly based on the field arrived in?
>Do you change back on depart?
>
>
>There is also some reported / rumored memory leaks when using external DLLs,
>try to call them only when needed.
>
>
>
>Liz McGuire <liz@paradoxcommunity.com> wrote:
>>Is it still working? It looks right to me. The only thing that seems
like
>an obvious
>>change would be to have an "otherwise" in your switch and set sId to whatever
>your
>>default keyboard language is - just in case (and even if other code makes
>it impossible
>>- always better to handle every possibility.
>>
>>Liz
>>
>>
>>On 24 Feb 2023 16:31, Linda wrote:
>>> Hi.
>>> After much research I have managed to change the keyboard layout when
>entering
>>> a field in bilingual registration, because I want to change automatically
>>> to right keyboard when entering values in the alternative fields.
>>> Until now it function very well, but is this the right way to do it with
>>> this window API?
>>>
>>> Uses "USER32.dll"
>>> LoadKeyboardLayoutA(iLanguageID cptr,iFlags cLong ) cLong
>>> endUses
>>>
>>> ; Form or library
>>> method ChangeKeyboard(sLanguage string, iId smallInt) string
>>> switch
>>> case sLanguage="NO" : sId="00000414"
>>> case sLanguage="TH" : sId="0000041e"
>>> case sLanguage="US" : sId="00000409"
>>> endSwitch
>>> RETURN sId
>>> endMethod
>>>
>>> ; Field or record
>>> method arrive(var eventInfo MoveEvent)
>>> dodefault
>>> LoadKeyboardLayoutA(ChangeKeyboard("TH"),1)
>>>
>>> endMethod
>>>
>>> Linda
>
|