Jump to content
Sign in to follow this  
123disconnect

help with hotkeyset

Recommended Posts

123disconnect

hotkeyset("{LEFT down}","func_call") is not work

anyone . can you say to me why ?

i see on help file V3.3.0.0 and understand hotkeyset is same format as send()

Edited by 123disconnect

Share this post


Link to post
Share on other sites
Xenobiologist

Have a look at _isPressed. I guess this is more what you are looking for.


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
martin

hotkeyset("{LEFT down}","func_call") is not work

anyone . can you say to me why ?

i see on help file V3.3.0.0 and understand hotkeyset is same format as send()

Use

HotKeySet("{LEFT}","func_call)

Hotkeys all work on the keydown event. If you want to detect down and up separately you could do something like this-

#include <misc.au3>

hotkeyset("{LEFT}","func_call") 
Global $LeftIsDown=false

while 1
    sleep(50)
    if $LeftIsDown and Not _IsPressed("25") Then
        func_call2()
        EndIf
WEnd


func func_call()
    HotKeySet("{LEFT}");prevent repeated calls while key down
    $LeftIsDown = True
    ConsoleWrite("Left is down" & @CRLF)
EndFunc

func func_call2()
    $LeftIsDown = False
    ConsoleWrite("Left is UP" & @CRLF)
    hotkeyset("{LEFT}","func_call")
EndFunc

or without HotKeys

#include <misc.au3>

Global $LeftIsDown=false

while 1
    sleep(50)
    check()
WEnd

Func check()
    if $LeftIsDown and Not _IsPressed("25") Then
        func_call2()
    EndIf

    If (Not $LeftIsDown) and _IsPressed("25") Then
        func_call()
    EndIf
EndFunc

func func_call()
    $LeftIsDown = True
    ConsoleWrite("Left is down" & @CRLF)
EndFunc

func func_call2()
    $LeftIsDown = False
    ConsoleWrite("Left is UP" & @CRLF)
EndFunc

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  

×