Jump to content

end script with press the right-mouse-button or a letter


Recommended Posts

I know that already

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

@catman380

That's NOT True, i run the code i posted and it's ok

you need to put the hotkeyset in a loop , otherwise, it's exit immediately ...

please give advise when you know what you are doing

@dark

Did you try and run my code? or did you just assume it wouldn't work. You don't need the Hotkey in a loop because it just needs to be set once according to the documentation, which I read before I posted. From the script that he showed he didn't need to loop through anything he just did a few mouse clicks, and nothing else. Just doing a few mouse clicks then nothing else infers that he doesn't need a while loop to keep doing nothing. That means he wants to interrupt the mouse clicks. Now if he wants to continually do mouse clicks until he presses q, then that's a different story. But the setting of a hotkey doesn't need to be continously set, it basically creates an event trigger that can interrupt anything including a sleep to run a user function. Perhaps you should know what you are doing before giving advice and flaming someone else who was right.

This is the example from the documentation:

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")  ;Shift-Alt-d

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc
Link to comment
Share on other sites

Ok,sorry ... i'm just heatting myself ...

BTW, my code will run and give him chace to press "q" to exit, but your code won't

Edited by d4rk

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

I believe this was what the OT asked for in the first place:

#include <misc.au3>
Global $dll=DllOpen("user32.dll")
AdlibEnable("_Check",10)

while 1
    sleep(10)
WEnd

Func _Check()
    If _IsPressed("02",$dll) Then Exit
EndFunc

:)

Broken link? PM me and I'll send you the file!

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...