limelect 48 Posted April 23, 2023 (edited) I have made with AutoHotkey (20 years ago) a script that sends a string to ANY edit It can be a text editor, internet explorer any text area The idea that works by pressing winkey (the 4 squares on the keyboard) and a number Demo winkey+ 1 2 3 Delphi, Android, Android Studio Sorry for the long explanation Now to my knowledge question No memo or edit component works. I have tested almost all text components on my Delphi and instead WinKey works as usual What is the difference between text editor or notpad++ or Notepad and many more? Even the Chrome (and all internet explorer) text area works with my command. It sends text to edit area P.S. If someone wants the script I will give it just send to my mail info. I just checked fmx and it is OK but on VCL it is not<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Edited April 23, 2023 by limelect Share this post Link to post
dummzeuch 1517 Posted April 23, 2023 VCL TEdit and TMemo are just wrappers around the Windows Edit Control, so they should work as any other edit control. If they don't, we need so see the code you use for sending the text to these. But maybe it's something else altogether: Maybe your script doesn't get called because these key presses get intercepted by something else? To find out whether that's the case you could add some debug code to your script that eg. plays a sound or shows a dialog. Share this post Link to post
limelect 48 Posted April 23, 2023 (edited) @dummzeuch The code will not help since it is an AutoHotkey script. It is compiled by AutoHotkey to execute. it is 10 lines very simple like #1:: Send, Delphi that's it !!! 10 lines like the above One can duplicate the line compile run the exe and see. In my case, it is so usable since if you write the same text over and over again this script is important for me at least. Obviously, debug does not help in this case But why in FMX it works? So it is VCL problem Edited April 23, 2023 by limelect Share this post Link to post
dummzeuch 1517 Posted April 23, 2023 The following AutoHotkey script works fine for me in a Delphi 2007 VCL program: <^>!;::Send ö +<^>!;::Send Ö <^>!'::Send ä <^>!@::Send Ä <^>![::Send ü <^>!{::Send Ü <^>!-::Send ß <^>!h::Send 🏠 Homeoffice <^>!p::Send 🍴 Pause <^>!f::Send 😎 Feierabend (The Unicode characters in the last three of course don't.) I also tried a Delphi 11 VCL program. There everything works as expected, including the 3 Unicode strings. So the Send command isn't the problem. Which means it probably is the Windows key you are trying to use as a trigger. Did you try my suggestion: 3 hours ago, dummzeuch said: To find out whether that's the case you could add some debug code to your script that eg. plays a sound or shows a dialog. Share this post Link to post
limelect 48 Posted April 24, 2023 (edited) @dummzeuchwell I did not work for 20 years with AutoHotkey so can you clarify if your code works with WinKey on VCL memo where this is the problem. On FMX as I said it works OK. Can you plz clarify what your code does? (I do not remember all the small AutoHotkey detail) Edited April 24, 2023 by limelect Share this post Link to post
dummzeuch 1517 Posted April 24, 2023 (edited) 2 hours ago, limelect said: Can you plz clarify what your code does? It catches the combination of the AltGr (the Alt key on the right hand side of the keyboard) with the given character keys and sends some text to the active window. E.g. it catches AltGr+{ and sends an upper case U umlaut. I use this to get German umlauts on UK keyboard layout by pressing AltGr + the key which on a German layout would be the umlaut in question. Some other key combinations are used to send not just one character but a string starting with the Unicode character for an emoji. These are status strings for WebEx, because that brain-dead UI keeps replacing my custom German strings with the English defaults. (I hate WebEx, but the alternatives don't seem to be much better.) As far as I understand it, your script does something similar. I haven't tried a memo, but I'm pretty sure it will work there too. I'll try to remember tomorrow to test it. Edited April 24, 2023 by dummzeuch Share this post Link to post
dummzeuch 1517 Posted April 25, 2023 10 hours ago, dummzeuch said: I haven't tried a memo, but I'm pretty sure it will work there too. I'll try to remember tomorrow to test it. I remembered and tried it: Works fine with a memo too. So your problem is not the send command but something else in your AutoHotkeyScript. As I said before: On 4/23/2023 at 2:41 PM, dummzeuch said: Which means it probably is the Windows key you are trying to use as a trigger. I still suspect that to be the case. Share this post Link to post
limelect 48 Posted April 25, 2023 @dummzeuch In my case it is WINKEY big difference. But still, in my case on FMX it works I wonder what the difference (in my case) between VCL and FMX P.S. nice to know that you too work on the same idea. Share this post Link to post