Bug in Send Command

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Bug in Send Command

26 Oct 2017, 08:55

I'm using 2 Keyboard Input Languages: English, Hebrew.
I make AHK script like this:

Code: Select all

^2::
Send, {Control Down}{v}{Control Up}
Sleep, 1000
When I run the script and press Ctrl+2:
It depends on my Keyboard Input Language at that time:
If Keyboard Input Language = English, then it works (=Paste).
But if Keyboard Input Language = Hebrew, then I get v (instead of Paste). Pressing 5 times Ctrl+2 you get:
vvvvv
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Bug in Send Command

26 Nov 2017, 02:09

This is by design. You asked it to send a 'v', so it sent a 'v'. If you want that key regardless of which printable character it produces, send the appropriate vk or sc code (probably vk56).
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: Bug in Send Command

26 Nov 2017, 12:06

lexikos wrote:This is by design. You asked it to send a 'v', so it sent a 'v'. If you want that key regardless of which printable character it produces, send the appropriate vk or sc code (probably vk56).
Hi lexikos, and thank you for your reply. I have to say that IMHO this behaviour must not be like this by design. Why?
The answer is quite clear for those who use several languages, but I'll try to expalin.
The transition between writing one language and another is done very frequently, every few seconds. Think, for example, that characters of Numbers [0-9], is another language, that is, every time you want to write a number, you need to change the Keyboard Input [done by Alt+Shift].
Everyone can understand that as far as this is concerned to keyboard shortcuts, this isn't up to the written language. You want that the same shortcut (pasting by Ctrl+V for example) to work whether you write English letters, whether you write numbers, or whether you write in another language.
More than that,
All the scripts in the forum are based on keyboard shortcuts assignment. Each time you change the language, it means that the script is broken. This mean, you can't use AHK Studio, AutoGUI, Pulover's Macro Creator, and any of scripts in the forum (unless you expect the user to rewrite them...)
If you insist on leaving the design as it is, I will have no choice but to ask for a special version of AutoHotkeyU32.exe \ AutoHotkeyU64.exe, or to accept the fact, with all the sorrow, that AutoHotkey is not for me.
Regards, Stamimail
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Bug in Send Command

26 Nov 2017, 14:57

What is the Hebrew shortcut key for pasting? Is it Ctrl+v or is it Ctrl+ה?


Because when I use Send ^ה in an AHK script, it pastes if I set my Windows language to Hebrew. My AHK is installed as Unicode 32 bit and my script editor -- Notepad++ -- encoded the file as UTF-8. If I run that same command when my language is set to English, it produces just the ה character. Basically the mirrored situation as trying to use ^v in English would paste, but in Hebrew it makes just a v.


Lexikos's suggestion of using Send ^{vk56} works for me to force pasting in both English and Hebrew.

Why? Because vk56 is tied to the physical key you pressed. v and ה are tied to what Windows think those keys are. Pasting in English is done with ^v and in Hebrew is done with ^ה. The v key in Hebrew is different from the ה key, vice versa in English. But the vk56 will refer to either of them depending on the current language. Think of it as vk56 will become v in English and ה in Hebrew. v is always v in English and Hebrew while ה is always ה in English and Hebrew. That's why leaving it up to the system to determine which key you want (exactly as if you were physically typing) by using the vk56 is how you can preserve pasting.

I hope this helps your understanding.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Bug in Send Command

26 Nov 2017, 19:41

Based on this problem, I've written this:
proof of concept: Send what you mean - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40546
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: Bug in Send Command

11 Dec 2017, 17:22

What is the Hebrew shortcut key for pasting? Is it Ctrl+v or is it Ctrl+ה?
Ctrl+v
No one says Ctrl+ה. All say Control C Control V.
This is also formally: https://snag.gy/pGZCxd.jpg
It is less important what the developer meant to, it is more important how AHK community interpreted the use of Send, and how the community is using it.
Lexikos's suggestion of using Send ^{vk56} works for me to force pasting in both English and Hebrew.
As been mentioned, it won't be logical to ask to convert each script found in the forum to this pattern Send ^{vkXX}. AHK should interpret Send ^v as Send ^{vk56} by itself.
In any case there should be no change in sending behavior, when the input language is changed.
Kajip

Re: Bug in Send Command

11 Dec 2017, 18:14

Stamimail wrote:
What is the Hebrew shortcut key for pasting? Is it Ctrl+v or is it Ctrl+ה?
Ctrl+v
No one says Ctrl+ה. All say Control C Control V.
This is also formally: https://snag.gy/pGZCxd.jpg
It is less important what the developer meant to, it is more important how AHK community interpreted the use of Send, and how the community is using it.
Lexikos's suggestion of using Send ^{vk56} works for me to force pasting in both English and Hebrew.
As been mentioned, it won't be logical to ask to convert each script found in the forum to this pattern Send ^{vkXX}. AHK should interpret Send ^v as Send ^{vk56} by itself.
In any case there should be no change in sending behavior, when the input language is changed.
Happy Hannukah by the way :bravo:
Stamimail
Posts: 77
Joined: 06 Nov 2014, 08:48

Re: Bug in Send Command

12 Dec 2017, 04:52

I don't think this is the place, but it was nice, thank you. btw, according to the (hi)story, the "Bravo!" :bravo: goes to the Hasmoneans and to the one above made them the miracles. Happy Hannukah and peace to all.
Guest

Re: Bug in Send Command

12 Dec 2017, 05:05

You can use alternatives (legacy shortcuts) for ^c, ^x, ^v

Copy:
Control+Insert
^{Ins}

Cut:
Shift+Delete
+{Del}

Paste:
Shift+Insert
+{Ins}

See https://en.wikipedia.org/wiki/Cut,_copy ... _shortcuts

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, Marium0505 and 396 guests