Remapped Key To Trigger A Physical Key: How? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
abcjme
Posts: 65
Joined: 08 Mar 2018, 10:48

Remapped Key To Trigger A Physical Key: How?

27 May 2018, 14:56

Let's say that Space is remapped to be Ctrl,
but I also have Ctrl remapped to send Z.
Is there a way to make it so that pressing Space, on release, also acts to send Z?

(To extrapolate, if Space is not used as part of a key combo, then it should act like Ctrl pressed alone, and thereby send Z: as that's what Ctrl is remapped to do.)
Rohwedder
Posts: 7689
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Remapped Key To Trigger A Physical Key: How?

28 May 2018, 00:38

Hallo,
perhaps this:

Code: Select all

*Space:: ;part 1: Space remapped to Ctrl
	SetKeyDelay -1
	Send {Blind}{Ctrl DownR}
Return
*Space up:: ;part 2: Space remapped to Ctrl
	SetKeyDelay -1
	Send {Blind}{Ctrl up}
	If A_PriorKey = Space ;if Space is not used as part of a key combo
		Send, z ;on release sends Z
Return
Ctrl::z ;Ctrl remapped to Z
"Space is remapped to be Ctrl, but I also have Ctrl remapped to send Z".
You like making your life miserable, don't you?
abcjme
Posts: 65
Joined: 08 Mar 2018, 10:48

Re: Remapped Key To Trigger A Physical Key: How?

28 May 2018, 15:02

Rohwedder wrote: Hallo,
perhaps this:

Code: Select all

Send {Blind}{Ctrl DownR}
What is the "R" in "DownR"? It was crucial for making the script work properly.
Rohwedder wrote: You like making your life miserable, don't you?
Only in the short-term, haha. I've been developing a keyboard layout that's more efficient and even easier to learn than current layouts available (Dvorak, Halmak, etc.). It's nearly done, I'm just fine-tuning it now.
Rohwedder
Posts: 7689
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Remapped Key To Trigger A Physical Key: How?  Topic is solved

29 May 2018, 00:48

Topic: Press DownR
https://autohotkey.com/docs/commands/Send.htm
DownR (where "R" stands for remapping, which is its main use) tells subsequent sends that if the key is automatically released, it should be pressed down again when send is finished. …

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Performance, Rohwedder and 110 guests