Jump to content
Sign in to follow this  
flick

_Hold question

Recommended Posts

flick

#include <Misc.au3>

HotKeySet ( "{F1}", _HoldF2() )

Func _HoldF2()

While _isPressed(70)

Send("{F1 down}")

WEnd

Send("{F1 up}")

Return 1

EndFunc

how do I change _HoldF2() to the letter p?

Share this post


Link to post
Share on other sites
dbzfanatic
flick

It's rude to start a new topic on a question that's already been asked. Read how _IsPressed() works.

I did, this is edited script

I don't know how hold works and I can't find it in help file

Share this post


Link to post
Share on other sites
martin

I did, this is edited script

I don't know how hold works and I can't find it in help file

You won't find hold in the help file it's a function which uses _IsPressed and Send which are both in the help file. If you read about those you can see why _IsPressed has the parameter 70 and you can see how to do what you want. If you don't understand the function then you need to read the help file a lot more.

The script won't work as it is anyway.

This looks more like it should be for the F1 key option to hold down the F2 key. You can't use the F1 key to hold down the F1 key or it will never get released.

#include <Misc.au3>

HotKeySet("{F1}", "_HoldF2")
While 1
    If _IsPressed("1B") Then Exit;press escape to exit
    Sleep(50)
WEnd


Func _HoldF2()
    Send("{F2 down}")
    While _IsPressed("70")
        Sleep(50)
    WEnd

    Send("{F2 up}")

    Return 1
EndFunc ;==>_HoldF2
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.