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

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
zed6250jb
Posts: 54
Joined: 20 Apr 2024, 18:25
Contact:

trouble with shifted function to expand limited keyset.

25 Apr 2024, 18:53

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}"
}
User avatar
mikeyww
Posts: 27196
Joined: 09 Sep 2014, 18:38

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

25 Apr 2024, 19:09

Code: Select all

#Requires AutoHotkey v2.0

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

#HotIf GetKeyState('c', 'P')
+a::SendText 'm'
#HotIf
zed6250jb
Posts: 54
Joined: 20 Apr 2024, 18:25
Contact:

Re: trouble with shifted function to expand limited keyset.

25 Apr 2024, 19:52

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
User avatar
mikeyww
Posts: 27196
Joined: 09 Sep 2014, 18:38

Re: trouble with shifted function to expand limited keyset.

25 Apr 2024, 20:34

You can use any hotkey to define a variable. You can then use #HotIf to evaluate its value.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Bing [Bot], fizzle6325, Noitalommi_2, TAC109, teadrinker and 33 guests