AutoHotKey: remapping Alt+Shift+<plus> to \

1

I would like to have a autohotkey remap for Alt + Shift + nonnumpad_plus_sign (equivalent to Alt + ? in my keyboard) and have that send a backslash '\'

I've tried stuff like:

!+NumpadAdd::\ 

(which works, but I want to use the non-numpad + sign of the keyboard).

Also this works:

!+::\

(Alt + nonnumpad_plus_sign = \, but how can I have shift and + in the same line?)

Any ideas?

Thanks!

Edit: the solution for my case following the steps in the answer below is

!+SC00C::Send, / 

but also

!++::Send, / 

works as well, perhaps more elegant solution (the first + represents Shift, the second the + sign)

jlo

Posted 2019-10-17T10:35:00.960

Reputation: 123

Answers

1

To click the + key on my keyboard I need to type Shift+=.

Therefore Alt+Shift++ is remapped as follows:

!+=:: Send, \

If your keyboard is different, it might require a different combination.

For example, you may be able to define the key using its scan-code. To find it out:

  • Create a .ahk script containing this one line:

    #InstallKeybdHook
    
  • Run the script

  • Right-click its traybar icon (green H) and choose Open
  • Click the menu View > Key history and script info
  • Press the +
  • Press F5
  • Note the three-digits code that is next to the key

Assuming that the scan-code was 123, the following script might work:

!+SC123:: Send, \

harrymc

Posted 2019-10-17T10:35:00.960

Reputation: 306 093

On my keyboard to click the + key I just type the + key. Any idea how to adapt this accordingly? Thanks – jlo – 2019-10-17T11:48:23.493

I added another possibility. – harrymc – 2019-10-17T13:03:39.837

Actually, that last option did the trick. In my case: !+SC00C::Send, / From another forum got perhaps a more elegant solution: !++::Send, / (the first + is Shift, the second + sign) – jlo – 2019-10-17T17:28:12.300

The other solution might stop working with new versions of AutoHotKey. I think the SC00C option is safer. – harrymc – 2019-10-17T18:18:13.590