Need help making a code for pressing 2 keys [F1 and F2] simultaneously.
Press F1 to start <F1 left click F2> with time interval of 65ms then repeat. <F1 left click F2>
Press 2 Keys simultaneously
- DuckingQuack
- Posts: 219
- Joined: 20 Jan 2023, 18:20
Re: Press 2 Keys simultaneously
So if i understand correctly, you want to press F1 and get a repeating output of F1, LButton, and F2 every 65ms?
That’s not hard, but I’d like to confirm i understand first… would you like me to give you the resources to do it yourself?
That’s not hard, but I’d like to confirm i understand first… would you like me to give you the resources to do it yourself?
Best of Luck,
The Duck
The Duck
-
- Posts: 3
- Joined: 23 Mar 2023, 10:24
Re: Press 2 Keys simultaneously
@DuckingQuack
Yes, I've tried a couple of codes from google and youtube, but it seems like I'm doing something wrong and couldn't make it work in a way I wanted it to be.
Yes, I'd like to make one myself and learn from the resource you're about to provide. Thanks! Have a great day.
Yes, I've tried a couple of codes from google and youtube, but it seems like I'm doing something wrong and couldn't make it work in a way I wanted it to be.
Yes, I'd like to make one myself and learn from the resource you're about to provide. Thanks! Have a great day.
Re: Press 2 Keys simultaneously
@mephistoajj
Script with F1 act as toggle
and without F1 act as toggle
Script with F1 act as toggle
Code: Select all
$F1::
Repeat:=!Repeat
If (Repeat)
{
SetTimer, RepeatSub, 65
}
Else
SetTimer, RepeatSub, Off
Return
RepeatSub:
Send, {F1}{LClick 1}{F2}
Return
Code: Select all
$F1::
Loop
{
Send, {F1}{LClick 1}{F2}
Sleep, 65
}
Return
Esc::Reload ; since F1 cannot be toggled off, use Esc to reload script and stop current loop
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
-
- Posts: 3
- Joined: 23 Mar 2023, 10:24
Re: Press 2 Keys simultaneously
@off
Thank you for these, kind sir. Hope you'll have a great day ahead!
Thank you for these, kind sir. Hope you'll have a great day ahead!
- DuckingQuack
- Posts: 219
- Joined: 20 Jan 2023, 18:20
Re: Press 2 Keys simultaneously
@off
I think the OP wanted to learn how to write their script, but good job! Those are some wonderful examples.
@mephistoajj
Please feel free to ask questions about @off’s scripts if there’s any parts you don’t understand or would like clarification. Also, I would like to suggest upgrading to AHK v2 at some point, but the provided scripts are incompatible with v2, so maybe not right now.
I think the OP wanted to learn how to write their script, but good job! Those are some wonderful examples.
@mephistoajj
Please feel free to ask questions about @off’s scripts if there’s any parts you don’t understand or would like clarification. Also, I would like to suggest upgrading to AHK v2 at some point, but the provided scripts are incompatible with v2, so maybe not right now.
Best of Luck,
The Duck
The Duck
Re: Press 2 Keys simultaneously
@DuckingQuack
Oh, sorry about that :c i write those and post without thinking, My bad.
@mephistoajj
As DuckingQuack said, feel free to ask, if you dont understand what and how the specific code do
Oh, sorry about that :c i write those and post without thinking, My bad.
@mephistoajj
As DuckingQuack said, feel free to ask, if you dont understand what and how the specific code do
My Creations
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key
ControlProcess
IMG2HotString - Send image file easily with your hotstring!
CtrlSend - A small solution for sending keys to window in background that doesn't accept ControlSend's key