Sending the Space Sign With the Sendraw Command Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Sending the Space Sign With the Sendraw Command

28 Oct 2021, 07:39

Does anyone know how to send the space sign with the command “Sendraw”? When I type a space or spaces after this command, AutoHotkey does not recognize the space(s).
User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: Sending the Space Sign With the Sendraw Command

28 Oct 2021, 07:47

Using {Raw} is a fix (line 4).

Code: Select all

Send {Text} {Test}{F3}{Ins}{Shift down}3{Shift up}
Send {Space}
Send X
Send {Raw} Y^+!#{Enter}
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Sending the Space Sign With the Sendraw Command

29 Oct 2021, 07:50

Thank you. The addition of either {text} or {raw} after the Send command makes it possible to send a space as the first character. Is there any difference in functionality between {text} and {raw}?
User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: Sending the Space Sign With the Sendraw Command

29 Oct 2021, 09:13

Yes. It is explained in the documentation. I cannot explain it any better! :)

In practical terms, they often have a similar effect. I typically use {Text} rather than {Raw}.
The Text mode can be enabled with {Text}, which is similar to the Raw mode, except that no attempt is made to translate characters (other than `r, `n, `t and `b) to keycodes; instead, the fallback method is used for all of the remaining characters. For SendEvent, SendInput and ControlSend, this improves reliability because the characters are much less dependent on correct modifier state. This mode can be combined with the Blind mode to avoid releasing any modifier keys: Send {Blind}{Text}your text. However, some applications require that the modifier keys be released. `n, `r and `r`n are all translated to a single Enter, unlike the default behavior and Raw mode, which translate `r`n to two Enter. `t is translated to Tab and `b to Backspace, but all other characters are sent without translation. Like the Blind mode, the Text mode ignores SetStoreCapsLockMode (that is, the state of CapsLock is not changed) and does not wait for Win to be released. This is because the Text mode typically does not depend on the state of CapsLock and cannot trigger the system Win+L hotkey. However, this only applies when Keys begins with {Text} or {Blind}{Text}.
https://www.autohotkey.com/docs/commands/Send.htm#SendText
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Sending the Space Sign With the Sendraw Command

30 Oct 2021, 10:59

Thank you for the reference. If I want to send only space characters, what command is to be used? (When I write Send {Text} , AutoHotkey does not recognize the spaces after {Text}.)
gregster
Posts: 9023
Joined: 30 Sep 2013, 06:48

Re: Sending the Space Sign With the Sendraw Command  Topic is solved

30 Oct 2021, 11:05

A few options:

Code: Select all

q::Send % "{text}   "    ; three spaces
w::Send {text}%A_space%  ; one space
e::Send {text}`  `   	 ; two spaces
User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: Sending the Space Sign With the Sendraw Command

30 Oct 2021, 11:21

Also:

Code: Select all

Send {Space 3}
(in case you don't really need Text mode)

Also:

Code: Select all

Send {Text}   `
Explained: Send an extra space or tab at the end
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Sending the Space Sign With the Sendraw Command

31 Oct 2021, 12:15

Thank you. There are a number of ways to achieve the same result when the intended goal is simple.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 218 guests