1

I have a bunch of RWin+X => Y mappings. I would like RAlt to be mapped to RWin so that RWin+X == RAlt+X. For example:

; RWin+J => Left
>#j::SendInput,{LEFT}

Which works fine, I can hold down RWin and press j and it would keep sending Left. Now let's add before that map the following:

RAlt::RWin

If I hold RAlt then press j, it would send a Left correctly, but if I keep holding RAlt and press j again, it would send a j and not Left. I would have to release RAlt and press it again.

Is there any way to fix that?

vexe
  • 5,433
  • 12
  • 52
  • 81
  • I don't think it's possible. Why can't you assign the same action to both keys? – wOxxOm Sep 30 '15 at 14:53
  • Well I had some issues mapping `RAlt`, for example I have this map `>#^!j::SendInput,^!{LEFT}` - which maps `RWin+Ctrl+Alt+j` to `Ctrl+Alt+Left` - problem is If I use `>!` instead of `>#` ahk gets confused because there's two Alts now involved. I tried specifying that I want `<!` instead of `!` can't remember exactly what it gave me but it's either an error or it got confused again giving me erroneous maps. RWin was working fine so I thought I'd map RAlt to it because it's easier to press and puts less strain on my hand. I might just go with the RAlt maps and ignore the ones that has `!` – vexe Sep 30 '15 at 15:16
  • Could it be that your keyboard has an AltGr key instead of a right-Alt key? http://ahkscript.org/docs/Hotkeys.htm#Symbols – user3419297 Sep 30 '15 at 18:48

1 Answers1

1

This what I came up with based on your issue. It's a work around solution:

#J::
If (GetKeyState("RAlt", "P") Or GetKeyState("RWin", "P")) {
    SendInput,{LEFT}
}
Return

RAlt::
While GetKeyState("RAlt", "P") {
        ; Add any Key in {Key} format followed by Period . that you want to act as an EndKey.
        Input, Key, L1 M T1, {space}.{esc}.{shift}.{enter}
                         .{tab}.{backspace}.{alt}.{home}
                         .{delete}.{pgup}.{pgdn}.{end}
                         .{up}.{down}.{left}.{right}
            If (Key <> "") {
                SendInput, {RWin down}{%Key%}{Rwin Up}
                }
            If InStr(ErrorLevel, "EndKey:") 
                Send % "{" . StrReplace(ErrorLevel, "EndKey:") . "}"
    }
Return
errorseven
  • 2,672
  • 2
  • 14
  • 20