1

My question is the same as keymap swap underscore and dash, but for Windows instead of Linux. How might I swap the dash - and underscore _ keys so that underscore is shift-less?

I tried using but it wouldn't let me use a chord, only single key press.

I also tried keyboard manager Remap Shortcut, but it wouldn't allow matching a chord with a single key, both source and target have to be chords. Update: it does allow swapping a chord with a single key, but not AND use the reverse at the same time.

Update2

This PT configuration only outputs dash: PT keyboard manager

can't select underscore

It may well be that either program actually can do this but I failed to find the right path. At any rate, I need help. Any suggestions?

Keyboard layout is US-ANSI.

3
  • You could always try modifying keyboard manager yourself so it would allow cord with a single key, although, there might be an underline reason why it's not allowed. What is the error message when you attempt to do that (so I can look at the script).
    – Ramhound
    Dec 13, 2021 at 19:08
  • @Ramhound there is no error message. I added screenshots. Dec 13, 2021 at 19:16
  • If you are willing to modify the source and do the required debugging, you can modify the source of the editor, to list the underscore character.
    – Ramhound
    Dec 13, 2021 at 21:21

2 Answers 2

4

You can use the free AutoHotkey V1.

To swap _ and - you could use a AutoHotkey script such as:

$-::Send, _
$_::Send, -

After installing AutoHotKey, put the script in a .ahk file and double-click it to test. You may stop the script by right-click on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group at C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

Useful AutoHotkey documentation:

2
  • That exact script didn't work for me, instead, I used this: ``` #Requires AutoHotkey v2.0 $-::Send '' $::Send '-' ``` Maybe it's a v2.0 change? Either way, your answer is effectively right, but this might be helpful for others reaching this. Side note: the $ prevents the Send command from triggering the other swap
    – Tim Child
    Mar 28 at 17:47
  • You're right, I modified the answer to add the forgotten "AutoHotkey V1".
    – harrymc
    Mar 28 at 17:50
0

The AutoHotkey V2 version of the answer by @harrymc is:

#Requires AutoHotkey v2.0
$-::Send '_' 
$_::Send '-' 

I.e., add that to a .ahk script, and double-click it to load it into AutoHotkey.

Note: $ prevents the Send command from triggering the other swap recursively.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .