phuongthuylinhnga Posted September 19, 2021 Posted September 19, 2021 I'm Vietnamese. I have "Unikey" - a software to type Vietnamese language to anywhere I can type in window 10. Example: I type: aa it's show â, type as it's show á,... aas --> ấ, eex --> ễ. dd --> đ..... I can type Vietnamese language like this to notepad, word, excel, window, folder name, web browser, ... But I can't type like this to Input or Edit in autoit Gui. How I can type Vietnamese language like this to Input or Edit in autoit Gui. I choosed UTF-8 with Bom but I just can type Vietnamese language in Scite Script Editor, I can't type Vietnamese language to Input or Edit in autoit Gui. Please help... #include <GUIConstantsEx.au3> $gui=GUICreate('new',420,260,430,200) $input=GUICtrlCreateInput('',10,10,400,20) $edit=GUICtrlCreateEdit('',10,40,400,200) GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch Until False
Zedna Posted September 20, 2021 Posted September 20, 2021 (edited) Try to change font of input/edit controls. Maybe there is some default font not supporting your specific (Unicode?) language in your OS. This is just idea/hint ... Look at: GUISetFont() GUICtrlSetFont() Edited September 20, 2021 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 Thanks for replies. Yes, these words are unicode. I do follow your tip, I use GUISetFont,GUICtrlSetFont,GUICtrlSetStyle but it can't too.
Nine Posted September 20, 2021 Posted September 20, 2021 I believe the problem comes from using Unikey software, which translates recently typed characters into a new character. AutoIt (with HotKeySet and other means) is probably interfering with Unikey. I do not think that it is a font issue. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 I dont use hotkeyset in script. I say wrong a little, I choosed UTF-8 with Bom but I can't type Vietnamese language in Scite Script Editor too. I just can type Vietnamese language to notepad and cut it to Scite Script Editor, and it's show Vietnamese corectly. I use like GUICtrlSetData($edit,"Tiếng Việt") and press F5 it show vietnamese corectly too. But I can't type Vietnamese language append that text.
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 yes, maybe Unikey and Autoit are incompatible with each other
Nine Posted September 20, 2021 Posted September 20, 2021 Understand. Even if you do not use HotKeySet in your script, AutoIt core has a provision for the case you would. This is in my opinion why it is interfering... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 When I open notepad in start menu and use: Send(" as as") it show " á á" . when I open notepad by Autoit and use : Run('notepad.exe') $hwnd=WinWait('Untitled') Send(' as as')
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 I'm newbie I can't edit this post. I create new. When I open notepad in start menu and use: Send(" as as") it show " á á" . when I open notepad by Autoit and use : Run('notepad.exe') $hwnd=WinWait('Untitled') Send(" as as") It show " as as" I think problem maybe is Autoit... So, I still dont know how to type vietnamese language to edit/input. Thanks for all replies
Zedna Posted September 20, 2021 Posted September 20, 2021 Try to use ControlSend() instead of Send() according to this remark in AutoIt's helpfile for Send() Quote When running a script on a remote computer through a program as psexec (www.sysinternals.com) or beyondexec (www.beyondlogic.org) it is necessary, specially when sending strokes to a program launch by the script with a Run() function, to use ControlSend() or other ControlXXX functions to directly communicate with the control. Send() even with Opt("SendAttachMode", 1) will not work. Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted September 20, 2021 Posted September 20, 2021 Also try to use SendKeepActive() and finally try to split your sent string by StringSplit() and send it to your target window (Notepad) one char by one char like this: Run('notepad.exe') $hwnd=WinWait('Untitled') MySend(" as as") Func MySend($s) $s = StringSplit($s,'') For $i = 1 To $s[0] Send($s[$i]) Next EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search
Nine Posted September 20, 2021 Posted September 20, 2021 I think you are mixing things up. Unless I do not understand your issue, you are not sending keys to your GUI, you are typing it, right ? Sending keys to another process (whatever the way you started it) does not prove anything. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 I'm not mixing things up. I just want type Vietnamese language in input/edit of my gui . And @Nine said: "it is interfering..." so I just check what he said. By open notepad by autoit and StartMenu so it's different between 2 ways, I've just test that after he said and I wrote what I've tested. I think autoit affect to window "notepad" or window "gui" so I can't type vietnemse language. I used controlsend and send each character (insert each sleep(1000) between them), it can't type vietnamese too. If you want test or check what I say, you can download run unikey to test or check. It's safe, whole vietnamese people use this: https://www.unikey.org/assets/release/unikey43RC5-200929-win64.zip. You can run it and choose like this image, change tray icon unikey from "E" to "V" to type vietnamese language, example: type : "as" it's show "á", "vieejt nam" it's show "việt nam". It's take your time so much, maybe you don't test or check. But i'm just telling you to understand what is my problem: "I just want type Vietnamese language in input/edit of my gui"
phuongthuylinhnga Posted September 20, 2021 Author Posted September 20, 2021 I think Send() like "type by keyboard". I dont say controlsend or another send. My problem is type to input/edit by keyboard, it don't show vietnamese language.
Nine Posted September 20, 2021 Posted September 20, 2021 OK, Lets just forget about UniKey. I did not write this software so I cannot tell how it reads the keyboard. All I am saying is that UniKey is probably not compatible with AutoIt. If you absolutely need this kind of functionality using AutoIt, I suggest you write your own "UniKey" in AutoIt and embed the code within your GUI. That will solve your problem. To start you up see _WinAPI_SetWindowsHookEx example in AutoIt help file. Put something together, then we will be able to help you effectively. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Gianni Posted September 20, 2021 Posted September 20, 2021 maybe this udf can be of use for you: https://www.autoitscript.com/forum/topic/68422-hotstrings-string-hotkeys/ Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Nine Posted September 23, 2021 Posted September 23, 2021 @phuongthuylinhnga Just finished this UDF that should help you (especially the characters sequence replacement feature) : “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now