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.

matt wilkie
  • 5,015
  • 23
  • 57
  • 85
  • 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 '21 at 19:08
  • @Ramhound there is no error message. I added screenshots. – matt wilkie Dec 13 '21 at 19:16
  • If you are willing to modify the source and do the required debugging, you can modify the [source](https://github.com/microsoft/PowerToys/tree/main/src/modules/keyboardmanager/KeyboardManagerEditor) of the editor, to list the underscore character. – Ramhound Dec 13 '21 at 21:21

1 Answers1

3

You can use the free AutoHotkey.

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:

harrymc
  • 455,459
  • 31
  • 526
  • 924