What I want to do is simple. I would like to rebind my keyboard such that the number bar (above qwertyuiop) is inverted (pressing "2" would send "@", and pressing "Shift+2" would send "2"), since I normally use the numpad for numbers, anyways. What I came up with is as you would expect:
Code: Select all
1::!
2::@
3::#
4::$
5::send, `% ; "5::%" doesn't compile
6::^
7::&
8::*
9::(
0::)
+1::numpad1
+2::numpad2
+3::numpad3
+4::numpad4
+5::numpad5
+6::numpad6
+7::numpad7
+8::numpad8
+9::numpad9
+0::numpad0
Code: Select all
:c:hi!::HI
*note: these characters aren't necessarily at the end of the hotstring, so although you may be able to get something along the lines of
Code: Select all
:cB0:hi::
if(A_EndChar == "!")
Send, {BS 3}HI
return
When I was looking into this I remember reading something about reg and k-hook hotstrings, and in my case, pressing 0-9 would reset the hotstring recognizer, which is no good. In the documentation of SendLeve, it mentions "...In some cases it can be useful to override this behaviour; for instance, to allow a remapped key to be used to trigger other hotkeys..." but messing around with it, I couldn't come up with a functioning solution.
I was messing around with making the numbers hotstrings, and using GetKeyState to see if it was the numpad or number bar that pressed it, but alas, I couldn't make that work, either (though I don't really fancy that soulution, since if 1! was pressed in a short enough time span where both keys were held down at the same time, that could send 11 or !!).
Also, my remapping script and hotstring scripts are in different files, so if there is a solution that works when scripts are separate (or at least #Include), that would be great.
Any help would be greatly appreciated. Thanks!