geekhack
geekhack Community => Keyboards => Topic started by: hoggy on Mon, 30 January 2012, 13:42:33
-
I think emacs has had this little gem for a while, but it's fairly new to me.
I want to remap the space bar to shift, but only when another key is pressed. If the space bar is pressed by itself, I'd like the space.
Does anyone know how I could achieve this? Using windows 7.
-
Good luck with this. I know you can't make a custom keyboard layout with Microsoft Keyboard Layout Creator to do this; I just tried.
Edit: Maybe AutoHotKey? Anyone?
-
Hmmm... im thinking autohotkey... doesn't autohotkey support IF statements?
-
I don't know how, but you can probably do it using AutoHotkey (http://www.autohotkey.com/).
-
A specific other key, or any key?
-
by other key, I mean 0-9, a-z, etc...
-
Found it
Space Up:: Send, % "{Shift Up}" (A_TimeSincePriorHotkey < 200 ? " " : "")
+Space:: Send, +{Space}
Space:: RShift
nabbed it from http://shi-ra-be.blogspot.com/2009/09/autohotkey1sands.html
-
What you want is
Space UP::
if (A_PriorKey = "space")
SendInput {Space}
SendInput {Shift Up}
return
Space::Shift
(Autohotkey_L required)
I can't type fluently like that, though, because whitespaces are only produced when space is released and not when it's pressed.
There's also another interesting script:
~space::shift
~ means the original key isn't hidden from the system, so the whitespace is produced immediately, but if you hold space afterwards it acts like shift.
I use neither.