Not able to send a backtick with SendInput

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
enterpad
Posts: 15
Joined: 22 Mar 2016, 20:38
Location: Montreal, Canada
Contact:

Not able to send a backtick with SendInput

22 Apr 2016, 09:01

Hi, I would like to type `something`with SendInput and I am not able to get the last backtick:

Code: Select all

F2::
  SendInput ``something``
return
With Win7 and 10, AHK Unicode 1.1.06.02 32-bit and 1.1.23.05 64-bit, Script UTF-8.

Did I miss something?
Enterpad - For those who need more than a few shortcuts
User avatar
kczx3
Posts: 1649
Joined: 06 Oct 2015, 21:39

Re: Not able to send a backtick with SendInput

22 Apr 2016, 09:30

The last backtick sends for me just fine use the exact hotkey you have shown there. Windows 7 64-bit, AHK 1.1.23.05 Unicode 64-bit. I even had the file saved as ANSI at first with UNIX style EOL chars. Changed it to UTF-8 with BOM and DOS style EOL chars and it still worked fine.
User avatar
enterpad
Posts: 15
Joined: 22 Mar 2016, 20:38
Location: Montreal, Canada
Contact:

Re: Not able to send a backtick with SendInput

22 Apr 2016, 11:37

Thank you kczx3, So I did more tests and found that the problem is related to our Canadian multilingual (French and English) keyboards. Windows displays nothing with a backtick alone with this kind of keyboard. It waits the following character to know what to display (e.g. `e will give è). This is why a backtick won’t appear if nothing else is following it. I will document appropriately this technicality on my side.
Enterpad - For those who need more than a few shortcuts
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Re: Not able to send a backtick with SendInput

15 Nov 2022, 11:05

It's the same with German keyboards.

For some reason it only worked for me with the following code (I also wanted the backtick to be sent from the backtick key itself, but without having to press another key afterwards)

Code: Select all

<^>´::Send, {``}{Space}
gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Not able to send a backtick with SendInput

15 Nov 2022, 11:16

Not sure how I am supposed to press <^>´ - probably a typo (missing a !), but this works for me on a german layout (AHK v1.1.35.00):

Code: Select all

Sendinput, {text}``			; or SendEvent

Edit:
To clarify, ALtGr and ´would require:

Code: Select all

<^>!´::Send, {text}``
(Mind the !. Then, <^>!´::Send, {``}{Space} from above should work as well.)
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Re: Not able to send a backtick with SendInput

15 Nov 2022, 15:04

gregster wrote:
15 Nov 2022, 11:16
Not sure how I am supposed to press <^>´
Strangely, I have all of this in my script and don't remember why anymore:

Code: Select all

<^>2::²
<^>3::³
<^>7::{
<^>8::[
<^>9::]
<^>0::send {}}
<^>´::Send, {``}{Space}
It's all simply CTRL+something, and it all works :eh:
gregster
Posts: 9113
Joined: 30 Sep 2013, 06:48

Re: Not able to send a backtick with SendInput

15 Nov 2022, 19:28

I see. <^ means left ctrl (as a modifier), but the > seems unnecessary here, because those keys 2, 3, 7,... and ´ are not (the right) part of a key pair (unlike Ctrl). Seems to get ignored though by AHK (or doesn't matter for those keys); but instead of <^>2, <^2 should already suffice. Anyway, if it works, it works. ;)

Since you are using a german layout, I thought you wanted to use <^>! which corresponds to the ominous AltGr key (see https://www.autohotkey.com/docs/Hotkeys.htm#Symbols), or LCtrl and RAlt.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: DecimalTurn, macromint, peter_ahk and 349 guests