Page 1 of 1

trouble with shifted function to expand limited keyset.

Posted: 25 Apr 2024, 18:53
by zed6250jb
My goal is that while I hold "shift" and "c"down (for example) so that when I press the "a" key the "m" key gets sent. Is this even possible?

Code: Select all

#Requires AutoHotkey v2.0

#HotIf WinActive("ahk_exe example.exe")
#c::
a:: {
		Send "{m}"
}

Re: trouble with shifted function to expand limited keyset.  Topic is solved

Posted: 25 Apr 2024, 19:09
by mikeyww

Code: Select all

#Requires AutoHotkey v2.0

+c:: {
 KeyWait 'c'
 If A_PriorKey = 'c'
  SendText 'C'
}

#HotIf GetKeyState('c', 'P')
+a::SendText 'm'
#HotIf

Re: trouble with shifted function to expand limited keyset.

Posted: 25 Apr 2024, 19:38
by zed6250jb
That's amazing, you're a genius!

Re: trouble with shifted function to expand limited keyset.

Posted: 25 Apr 2024, 19:52
by zed6250jb
Is there a way to toggle instead of before where it was shifted?
I have something like this, but instead of while Ins is held instead press once to switch back and fourth. Ideally a second tap would toggle to another function set.

Code: Select all

#Requires AutoHotkey v2.0

Ins:: {
 KeyWait 'm'
 If A_PriorKey = 'm'
  SendText 'M'
 KeyWait 'n'
 If A_PriorKey = 'n'
  SendText 'N'
}

#HotIf GetKeyState('Ins', 'P')
b::SendText 'n'
a::SendText 'm'
#HotIf

Re: trouble with shifted function to expand limited keyset.

Posted: 25 Apr 2024, 20:34
by mikeyww
You can use any hotkey to define a variable. You can then use #HotIf to evaluate its value.