Jump to content

hotkey stays down when func is done


Recommended Posts

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
Link to comment
Share on other sites

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.
Link to comment
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
Link to comment
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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...