Sign in to follow this  
Followers 0
Merchants

hotkey stays down when func is done

12 posts in this topic

hotkey stays down when func is done

this is very bothersome is there not a dll or a way to run a func to let ALL the hotkeys come up ?

already tryed: Send("{<Hotkey>Down}{<Hotkey>Up}")

Share this post


Link to post
Share on other sites



Can you post your full source ?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

not full but what i use..

Global $run

HotKeySet("!z", "start")

While 1
WEnd

Func start()
    some functions here
    While $run
        some functions here
        If ... = 0 Then
            $run = 0
        EndIf
    WEnd
EndFunc
Edited by Merchants

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This does not reproduce the issue so why post it and not post something that shows your problem?

Edit: Also after your edit.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

wel it is a very big script + i don't want to post my full script (private script)

Edited by Merchants

Share this post


Link to post
Share on other sites

wel it is a very big script + i don't want to post my full script (private script)

Don't even want to see it. post something sweet and simple that demonstrates the issue.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

pff then i have to make a demo i hope that works...

Share this post


Link to post
Share on other sites

pff then i have to make a demo i hope that works...

Well its simple: Either supply info or be prepared to pay the big bucks for the miracle you are asking for.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

got it i fond a way to make this demo simple open a notepad and run the script and press altdown+z

then if it stops then alt = down and not up you can see that easy via presing tab

Global $run, $index = "test", $i = 500, $p = True

Opt("MouseCoordMode", 2)

HotKeySet("!z","start")
HotKeySet("!w","start1")
HotKeySet("!s","start2")
HotKeySet("!x","start3")

While 1
WEnd

Func Start()
    $run = 1
    While $run
        ClipPut($index)
        MouseMove(10, 10, 0)
        MouseClick("Left")
        Send("^v")
        If $p = True Then
            ClipPut($index)
            Send("{Tab}{Sleep 5}^v")
        Else
        EndIf
        MouseMove(10, 10, 0)
        MouseClick("Left")
        Sleep($i)
        If PixelGetColor(109,9) = 0xAC9C64 Then
        Else
            $run = 0
        EndIf
    WEnd
EndFunc

Func Start1()
    HotKeySet("!w")
    $run = $run +1
    HotKeySet("!w","start1")
EndFunc

Func Start2()
    HotKeySet("!s")
    $run = $run -1
    HotKeySet("!s","start2")
EndFunc

Func Start3()
    HotKeySet("!x")
    $p = True
    HotKeySet("!x","start4")
EndFunc

Func Start4()
    HotKeySet("!x")
    $p = False
    HotKeySet("!x","start3")
EndFunc

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

pff then i have to make a demo i hope that works...

Check item 19 here before you wait for the miracle in case it's relevant.

EDIT:I see you are using Send in the function started by the hot key so my bet it that the link I gave is what you need to read.

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

how does this work ? can you give me a example

#include < Misc.au3 >
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys still down.
;Requires misc.au3 to be included in the script for the _IsPressed function.
Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
 
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(262144, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc;==>_SendEx

Share this post


Link to post
Share on other sites

how does this work ? can you give me a example

#include < Misc.au3 >
;Send the string $ss after the Shift Alt and Ctrl keys are released. Optionally give a warning after 1 sec if any of those keys still down.
;Requires misc.au3 to be included in the script for the _IsPressed function.
Func _SendEx($ss, $warn = "")
    Local $iT = TimerInit()
 
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
        If $warn <> "" And TimerDiff($iT) > 1000 Then
            MsgBox(262144, "Warning", $warn)
        EndIf
        Sleep(50)
    WEnd
    Send($ss)
EndFunc;==>_SendEx

With that function in your script, replace Send with SendEx. In your case use

SendEx("^v")

Then the "^v" won't be sent until the keys for the hotkey are released and you won't get the stuck key problem.


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  
Followers 0