When Ctrl, then w - Зажатие клавищ

Ask gaming related questions (AHK v1.1 and older)
DinaRake
Posts: 6
Joined: 05 Dec 2021, 08:28

When Ctrl, then w - Зажатие клавищ

Post by DinaRake » 05 Dec 2021, 08:44

Пожалуйста помогите чтобы при зажатии клавиши ctrl зажималась клавиша w, как отпускал ctrl также и отжималась кнопка w!!
==================================================================================================================
Please help so that when pressing the ctrl key, the w key is pressed, as the ctrl key is released, the w button is also pressed!!

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

Re: Зажатие клавищ

Post by mikeyww » 05 Dec 2021, 09:15

Code: Select all

Ctrl::
Ctrl Up::
Send w
KeyWait, Ctrl
Return

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: When Ctrl, then w - Зажатие клавищ

Post by Rohwedder » 06 Dec 2021, 07:47

Hallo,
if both keys are to be pressed simultaneously, then:

Code: Select all

~Ctrl::w

DinaRake
Posts: 6
Joined: 05 Dec 2021, 08:28

Re: When Ctrl, then w - Зажатие клавищ

Post by DinaRake » 06 Dec 2021, 19:08

@mikeyww
sorry, but can I do this when I have w clamped so that I press ctrl and it works 2 times w

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

Re: When Ctrl, then w - Зажатие клавищ

Post by mikeyww » 06 Dec 2021, 19:38

Provide the exact sequence of what you type, step by step, and the exact sequence of how AHK responds, step by step.

DinaRake
Posts: 6
Joined: 05 Dec 2021, 08:28

Re: When Ctrl, then w - Зажатие клавищ

Post by DinaRake » 07 Dec 2021, 06:02

@mikeyww
When pressing ctrl, it was pressed in order 2 times w

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

Re: When Ctrl, then w - Зажатие клавищ

Post by mikeyww » 07 Dec 2021, 06:36

Code: Select all

Ctrl::
Send ww
KeyWait, Ctrl
Ctrl Up::Return

DinaRake
Posts: 6
Joined: 05 Dec 2021, 08:28

Re: When Ctrl, then w - Зажатие клавищ

Post by DinaRake » 07 Dec 2021, 15:55

@mikeyww
wweverything works, but I need to run fast for the game, for some reason this code does not work in the game purely for the inscription?

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

Re: When Ctrl, then w - Зажатие клавищ

Post by mikeyww » 07 Dec 2021, 15:58

If it works in Notepad but not your game, then the issue is how the game responds. You could look at https://autohotkey.com/board/topic/111737-how-to-make-ahk-work-in-most-games-the-basics/.

Here is a script just to send lots of W.

Code: Select all

Ctrl::
While GetKeyState(A_ThisHotkey, "P")
 Send wwwww
Ctrl Up::Return

DinaRake
Posts: 6
Joined: 05 Dec 2021, 08:28

Re: When Ctrl, then w - Зажатие клавищ

Post by DinaRake » 08 Dec 2021, 03:09

@mikeyww
~Ctrl::w
from above, as I wrote it into the game, does it work, is it possible to do something here so that w is squeezed twice or so that the order is straight och fast

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

Re: When Ctrl, then w - Зажатие клавищ

Post by mikeyww » 08 Dec 2021, 05:38

For me, it still is not clear what you want to achieve, if none of these scripts work. The script from Rohwedder sends Ctrl+W when you press Ctrl. The sequence repeats while you hold the key. Check KeyHistory.

image211208-0540-001_cr-75.png
Key history
image211208-0540-001_cr-75.png (51.03 KiB) Viewed 913 times

Post Reply

Return to “Gaming Help (v1)”