Jump to content
Sign in to follow this  
limelect

winkey Just for knoledge

Recommended Posts

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 by limelect

Share this post


Link to post

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

@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 by limelect

Share this post


Link to post

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.

 

AutoHotkeyVCL.thumb.png.c66b1e53f071144fd78e004c65354f32.png

 

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

@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 by limelect

Share this post


Link to post
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 by dummzeuch

Share this post


Link to post
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.

AutoHotkeyTest-with-VCL-Memo.png.03fb6a059680d9ab9cea0a273a069407.png

 

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

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×