nacerbaaziz Posted December 28, 2019 Posted December 28, 2019 hello autoit group please i've a question i had make a function that put some thing into the clipBoard and paste it using the send function e.g ClipPut("hello") send("^v") when the keyboard is english all things work fine but when the keyboard is arabic the send command write the ltr v insted of the text in clipboard i was tryed to use send("{ctrldown}v{ctrlUp}") but the same please can any one help me
Nine Posted December 28, 2019 Posted December 28, 2019 You could try to _SendMessage with this notification. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Moderators JLogan3o13 Posted December 28, 2019 Moderators Posted December 28, 2019 Moved to the appropriate forum. Moderation Team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
nacerbaaziz Posted December 28, 2019 Author Posted December 28, 2019 @Nine, i don't know if it work with an external GUI this is the code that i tried i hope if it work with me because my program is spicielly to the arabs users for that the arabic must be in the keybord $text = "text to paste" $OldText = ClipGet() WinActivate($h_CRNTWND, ""); the handle of the Active Window do Until WinActive($h_CRNTWND) clipPut($text) BlockInput(1) Send("{CTRLDOWN}") sleep(20) Send("v") sleep(20) Send("{CTRLUp}") BlockInput(0) ClipPut($OldText)
Nine Posted December 28, 2019 Posted December 28, 2019 29 minutes ago, nacerbaaziz said: i don't know if it work with an external GUI Well the only way to know for sure is to test it, right ? Use the control handle of the input box you want to paste it to. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
nacerbaaziz Posted December 28, 2019 Author Posted December 28, 2019 1 minute ago, Nine said: Well the only way to know for sure is to test it, right ? Use the control handle of the input box you want to paste it to. hello sir, the problem i can't know the plase where the user paste, i tried controle set text, but the problem the user can paste the text into web edit or an GUI or java application, what am trying to make is an multi clipBoard i meen an clipboard history store for that i can't know the place where the user will paste it i tried the sendMessage with the handle of the window but it didn't work
Nine Posted December 28, 2019 Posted December 28, 2019 I see...Sorry, I don't know. But I am pretty sure there is a way to paste text with arabic keyboard, no ? Anyway, one last solution I can think of is to use Local $hWnd = _WinAPI_WindowFromPoint ($tPoint) to get the handle of a static input box. I tested and it works. Use preferably mouse position. Caret position may not work properly. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
nacerbaaziz Posted December 28, 2019 Author Posted December 28, 2019 but if the keyboard in arabic and i pressed control+v manualy it work with out problem
nacerbaaziz Posted December 29, 2019 Author Posted December 29, 2019 hello again please community there are no function can press the keys with not send command because i think the problem is with send function when i try to paste the text with ctrl+v manualy all thing work fine even if the keyboard is arabic or english or franch i couldn't find any solution to that i finished my tool this problem only if it corrected i'll share the tool to othersbut if the keyboard in arabic and i pressed control+v manualy it work with out problem
Nine Posted December 29, 2019 Posted December 29, 2019 Send is not the problem. I have a french keyboard, I am using send function all the time without a single issue. It is probably the window ($h_CRNTWND) that should receive the paste that is causing the problem. When I run your code, it works perfect. If you want us to help you, you must provide a runable script that replicates the dysfonction of the Send. Otherwise, I don't think anyone here can help you out. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
nacerbaaziz Posted December 29, 2019 Author Posted December 29, 2019 this code e.g when i run it and the keyboard in english or franch all things work fine but in arabic no it write the l V but when i press ctrl+v manualy it paste the text here is the code global $text = "some text" hotkeySet("^{f2}", "pasteText") hotkeySet("{esc}", "Kill") While 1 sleep(100) Wend func pasteText() local $crntClip = ClipGet() ClipPut($text) Send("^v") clipPut($crntClip) return 0 endFunc func kill() exit endFunc
Musashi Posted December 29, 2019 Posted December 29, 2019 No solution, just some links I found. These may or may not help you 🤔. Unfortunately your problem is hard to analyze without a script, as @Nine already wrote : https://www.autoitscript.com/forum/topic/79996-send-utf-8/?do=findComment&comment=576209 https://www.autoitscript.com/trac/autoit/ticket/462 https://stackoverflow.com/questions/23058634/wscript-sendkey-doesnt-accept-unicode-characters https://www.autoitscript.com/forum/topic/158795-send-ctrl-key-when-keyboard-layout-is-not-english/ https://www.autoitscript.com/forum/topic/197212-copy-control-c-when-keyboard-layout-isnt-english/ "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
nacerbaaziz Posted December 29, 2019 Author Posted December 29, 2019 hello team now i did a test and it successed i tried to send the l in arabic that in the same place to the l v it ر after that i've make a function to get the keyboard lng and i did an if to detect the kb lng here is the code and thank you for your help with my greetings expandcollapse popup#include <WinAPILocale.au3> global $text = "some text" hotkeySet("^{f2}", "pasteText") hotkeySet("{esc}", "Kill") While 1 sleep(100) Wend func pasteText() local $crntClip = ClipGet() ClipPut($text) Send("{CTRLDOWN}") if GetSystemLNG(@KBLayout) = "arabic" then Send("ر") else Send("v") endIf send("{CTRLUp}") clipPut($crntClip) return 0 endFunc func kill() exit endFunc func GetSystemLNG($String = "") if $String = "" then local $s_Lng = _WinAPI_GetLocaleInfo(0x0400, 0x0001) else local $s_Lng = $String endIf local $LngID ='0x' & StringTrimLeft($s_lng, 4) & StringTrimLeft($s_lng, 4) local $idBord = _WinAPI_GetLocaleInfo(BitAND($LngID, 0xFFFF), 0x1001) return $idBord endFunc #include <WinAPILocale.au3> global $text = "some text" hotkeySet("^{f2}", "pasteText") hotkeySet("{esc}", "Kill") While 1 sleep(100) Wend func pasteText() local $crntClip = ClipGet() ClipPut($text) Send("{CTRLDOWN}") if GetSystemLNG(@KBLayout) = "arabic" then Send("ر") else Send("v") endIf send("{CTRLUp}") clipPut($crntClip) return 0 endFunc func kill() exit endFunc func GetSystemLNG($String = "") if $String = "" then local $s_Lng = _WinAPI_GetLocaleInfo(0x0400, 0x0001) else local $s_Lng = $String endIf local $LngID ='0x' & StringTrimLeft($s_lng, 4) & StringTrimLeft($s_lng, 4) local $idBord = _WinAPI_GetLocaleInfo(BitAND($LngID, 0xFFFF), 0x1001) return $idBord endFunc
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