How can I set an edit control to be Latin-only? Topic is solved
-
- Posts: 512
- Joined: 03 Dec 2018, 20:02
How can I set an edit control to be Latin-only?
When an input method is on one would have to switch it off to enter latin letters directly, is there any way to make an edit control declare that it only accepts latin letters, temporarily switch to English input, and switch back after losing focus?
Re: How can I set an edit control to be Latin-only?
One workaround could be to set temporary hotkeys that ignore characters that should not appear.
Re: How can I set an edit control to be Latin-only? Topic is solved
Code: Select all
DisableControlIME(hWnd, bDisable := true) {
flag := bDisable ? 0x0020 ; IACE_IGNORENOCONTEXT
: 0x0010 ; IACE_DEFAULT
DllCall("Imm32\ImmAssociateContextEx", "ptr", hWnd, "ptr", 0, "uint", flag)
}
; Example
Gui, Add, Edit, xm w300 +HwndhEdit,
Gui, Add, Checkbox, x+10 hp vcb2 gDisableIME, Disable IME
Gui, Add, Edit, xm w300,
Gui, Show
Return
DisableIME:
GuiControlGet, b,, % A_GuiControl
DisableControlIME(hEdit, b)
Return
GuiClose:
ExitApp
Re: How can I set an edit control to be Latin-only?
That looks cool. Does that DLL call disable the non-Latin input? How does it do that?
-
- Posts: 512
- Joined: 03 Dec 2018, 20:02
Re: How can I set an edit control to be Latin-only?
@tmplinshi This is really gool (good&cool)! Thank you so much
Who is online
Users browsing this forum: Chunjee, Google [Bot], JKJadan, Psych0p4th and 274 guests