0

I use a program that uses \ as a shortcut.

I use a French AZERTY keyboard, where the backslash can only be typed using a key combination: Alt Gr+8 (or Ctrl+Alt+8).

So I cannot activate the shortcut (unless I switch Windows to a US keyboard layout).

I thought AutoHotkey would be able to solve the issue, but remapping a key to backslash does not work as intended:

; TRY 1: using Send
*::
Send \
return

; TRY 2: simple remap
$::\

AutoHotkey actually sends the key combination Ctrl+Alt+8, so the shortcut is not triggered.

Is there any way for AutoHotkey to send the "real" \ key, while keeping my AZERTY layout in Windows?

4
  • Try this example of mapping Ctrl-X to your key-sequence : ^x::send {Ctrl down} {Alt down} 8 {Alt up} {Ctrl up}
    – harrymc
    Apr 23, 2019 at 11:06
  • @harrymc This does not work. A key sequence is not recognized by the program as a valid shortcut. Doing this manually does work either.
    – Sébastien
    Apr 25, 2019 at 6:55
  • This worked for me, but may not solve your specific problem.
    – harrymc
    Apr 25, 2019 at 7:17
  • Try adding SetKeyDelay before the Send command or/and SendEvent {LCtrl Down}{RAlt Down}8{LCtrl Up}{RAlt Up}.
    – user1841271
    Sep 16, 2023 at 12:12

0

You must log in to answer this question.

Browse other questions tagged .