Ahk code using control to hold keys

Ask gaming related questions (AHK v1.1 and older)
VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 10:00

Hi, I need a code capable of holding the "q" key using the control. It's kind of complicated to explain, but I think you'll understand. When I press the "q" key, the control will be activated and it will only stop when I release the "q" key. I believe this is possible, because on a normal keyboard, after holding the control, you can't send anything, it kind of holds the keys.

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 10:07

Code: Select all

q::Ctrl

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 10:21

@mikeyww After I release the "q" key, it has to activate, understand? In that code you sent, the "q" doesn't work.
I need the control to hold while I press the "q", when I release the "q" must activate.

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 10:32

I do not understand. What the script does: 'When I press the "q" key, the control will be activated and it will only stop when I release the "q" key.'

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 10:42

@mikeyww It's something like this mechanic: c up::send wa. However, I want the control to hold the key, and when I release it, the key is activated

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 10:46

I am not following this. The instructions are vague to me. The original post says nothing about "c", "w", or "a". I don't know what key is meant, or what "activated" is.

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 10:53

@mikeyww Sorry, I'm using google translator, possibly strange words are coming out. Maybe this script I wanted is not possible to do :v

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 10:53

@VitinhoKeys Can you help me with something else?

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 11:10

That depends on the question.

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 11:19

@mikeyww is it possible to take the delay off the keys? I mean, make them respond faster?

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 11:32

You can use SendInput or change the SetKeyDelay. A remapping already uses a key delay of -1.

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 11:40

@mikeyww
Hmm understand, now going to another topic, do you know how to make scripts to copy sentences?

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: Ahk code using control to hold keys

Post by mikeyww » 05 Dec 2021, 11:45

I suggest creating a new post with the question. Include a specific example. In your post, define a sentence, too.

VitinhoKeys
Posts: 9
Joined: 03 Dec 2021, 11:09

Re: Ahk code using control to hold keys

Post by VitinhoKeys » 05 Dec 2021, 12:04

@mikeyww
Ok

Post Reply

Return to “Gaming Help (v1)”