Simple remap script consultation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hermitianc
Posts: 1
Joined: 08 May 2024, 09:10

Simple remap script consultation

08 May 2024, 09:53

Hello, for context: I am playing an organ vst using my pc keyboard and I need autohotkey to play an octave using Space.

I am trying to do the script for the following remap:
I press space, autohotkey sends it to quick succession of Ctrl + Shift + w + x,
and if I hold space it holds w+x.

Just to illustrate:

Space ----> Ctrl, Shift, w, x
If I hold Space it continues to hold w and x only, releasing Shift and Ctrl.

My attempt:

Code: Select all

Space:: 
	Send, {Ctrl down}{Shift down}{w down}
	sleep 10
	Send,{x down}
	KeyWait, Space
	Send, {Ctrl up}{Shift up}{w up}{x up}
return
It doesn't work as I intended. Thanks for any help in advance.

[Mod edit: Moved topic from AHK v2 help since this is v1 code.]
Rohwedder
Posts: 7710
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Simple remap script consultation

08 May 2024, 11:15

Hallo,
according to your requirement, it should work like this:

Code: Select all

Space:: 
	Send, {Ctrl down}{Shift down}{w down}
	sleep 30
	Send, {Blind}{x down}
	sleep 30
	Send, {Ctrl up}{Shift up} ; hold w and x only, releasing Shift and Ctrl
	KeyWait, Space
	Send, {w up}{x up}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 86 guests