3

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

3
  • 1
    Please don't totally change the question and then vote down answers against the previous text! That is just obnoxious. Mar 26, 2015 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, 2015 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. Mar 26, 2015 at 23:21

2 Answers 2

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.

2
  • 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. May 9, 2015 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... May 10, 2015 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).

You must log in to answer this question.

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