3

For example, can I make Space + J act as Ctrl + J, and Space act as Space when pressed on its own?

fixer1234
  • 27,064
  • 61
  • 75
  • 116
Joelmob
  • 133
  • 1
  • 5
  • 1
    Please don't totally change the question and then vote down answers against the previous text! That is just obnoxious. – Julian Knight Mar 26 '15 at 21:51
  • @JulianKnight I have never downvoted your answer. Sorry for that, this change was meant to have same meaning as previous – Joelmob Mar 26 '15 at 22:55
  • I wasn't accusing anyone specific, just getting frustrated by anonymous downvoters - a problem that seems to be getting worse on SuperUser. Actually, I'm not really worried by downvotes if my answer is actually wrong, but when people do it anonymously, they don't give anyone a chance to improve the quality of questions and answers. – Julian Knight Mar 26 '15 at 23:21

2 Answers2

2

Yes, you can do this using AutoHotkey (an excellent free keyboard-mapping tool).

Once you download and install AutoHotkey you can create a script file with the following contents:

#NoEnv SendMode Input

~Space & j:: Send ^j

Return

Then just run that script file (right-click, Run Script) and AutoHotkey will send Ctrl+J when you press Space+J, and if you press Space by itself that will pass through just fine.

nathanbedford
  • 364
  • 3
  • 8
  • Unfortunately the space still gets inserted (tested on . A solution could be to add a backspace, but that may not always work (for example the space may accept an auto-completion suggestion, just like enter may send a message). Some solution is needed to suspend the space before the key is released. – Markus von Broady May 09 '15 at 14:10
  • Hmm...this worked when I added this in March (on an older version of AHK) but Markus is right, it doesn't work with the latest. I'll investigate a bit later... – nathanbedford May 10 '15 at 14:49
0

To add to Nathan's answer, if you don't want to still insert a (space) after using space+J combo, you can use this script:

Space & j:: Send ^j
return
Space:: Send {Space}
return

This will block your space in all combinations, not only the one registered. This will also add a small lag to your space and possibly force you to learn to delay keystrokes after space. Alternatively, you can use Nathan's solution but add a Backspace:

~Space & j:: Send {BS}^j
return

But you must be aware not to use the combinations in cases where space does something more than inserting a space (a space could for example accept autocompletion).