I'm trying to overload my keyboard.

CapsLock & J::Send {Left} ..is the left arrow, you can guess the other directions.

CapsLock & H::Send ^{Left} ..is jump word left.

I started adding a lot of extra and I am running out of keys, so I thought I would like to introduce extra modifiers like D could be de "Delete modifier". CapsLock+D+J would delete a char form the Left (like Backspace key), CapsLock+D+L would delete a char from the right (like Delete key).

Additionally, S would be my Speedy modifier like Ctrl, meaning "jump words". So CapsLock+S+D+J would delete a word to the left.

If I could only... -bind to 3+ keys, that would solve it. -bind to any keyup/down and process it in if-else blocks, that would solve it.

Ideas appreciated.

| improve this question | | | | |

Three modifiers like CapsLock & H & D cannot be used.

You can use GetKeyState and combine it with hotkeys and if or switch statements to make any combination.

| improve this answer | | | | |
  • Why didn't you make this an official answer? – Robert Ilbrink Mar 25 '13 at 14:09
  • I new about GetKeyState but I forgot to state that in my question, and it is quite relevant so I accept your answer, although I also posted what really did it. Thank you though, Armin. – boomla Mar 27 '13 at 12:21

The trick to catch any keyup/down event happens to be this:

*d::msgbox, d down
*d up::msgbox, d up

Note that "d down" fires many times until you release it. * stands for any modifier keys like shift/alt/ctrl/win (or nothing).

To handle anything I use sg. like this:

updateState(key, dir) {..}

*a::updateState("a", "down")
*a up::updateState("a", "up")
*b::updateState("b", "down")
*b up::updateState("b", "up")
*c::updateState("c", "down")

and I store all the key states I need in variables like key_a, key_b, key_capslock, ..

Also, the current event is in a variable like a_down, a_up, b_down, b_up, ..

Then I can use if-else statements like

if(key_capslock and key_d and key_f and j_down) {
    ; do whatever

No, I can't recognize any speed decrease while typing.

If the CapsLock is not pressed I use the following to "pass through" the normal keyboard functionality:

; DEFAULT keyboard
if(key_capslock = 0) {
        shift := "+"
        ctrl := "^"
        alt := "!"

    if(dir="down") {
        event = {%key% down}
    else {
        event = {%key% up}

    SendInput, %shift%%ctrl%%alt%%event%

Edit: Note that some keys can not be detected at the same time, as (most?) keyboards have a matrix layout with horizontal and vertical wires. Once a key is pressed, 1 horizontal and 1 vertical wire is used, thus a next keypress/release sharing any of these wires can not be accurately detected. For that reason, I can't use S and JKL at the same time, hence I use F for FAAST instead of S for SPEEDY. :/

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.