Jump to content

Recommended Posts

Posted

Hello all,

I was just about to post a question about this when I found a workaround.

See, this was my problem. I had a nice script, but pressing escape made it exit.

My solution?

HotKeySet("{ESCAPE}", "escapeFunction")
Func escapeFunction()

EndFunc

I know it's not a perfect solution, but I wanted to share it anyway. If anyone's got a better idea, I'd love to hear it.

Robin

Posted (edited)

Yeh, that's the opposite of what I mean...

I want Escape NOT to stop my script, thought I said that :D

EDIT: Yeh, I did

Edited by Robbinski12
Posted (edited)

Another alternative

#Include <Misc.au3>

while 1 ; put ur script here
    If _IsPressed("1B",'user32.dll') Then
    
EndIf
WEnd
Edited by Manjish
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

@manadar,

I know that he dosnt want to stop on esc..

That's exactly what my script does dude!! check!! :D

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted (edited)

But the problem is, without me writing it, it DOES now stop on escape :D

My question still is, how can I stop it doing that?

EDIT: With my solution (first post), I cannot use my escape key anymore because my script now catches it -,-

Edited by Robbinski12
Posted

But the problem is, without me writing it, it DOES now stop on escape :D

My question still is, how can I stop it doing that?

EDIT: With my solution (first post), I cannot use my escape key anymore because my script now catches it -,-

You should be in full control of your code. You wrote your script?

♡♡♡

.

eMyvnE

Posted (edited)

But the problem is, without me writing it, it DOES now stop on escape :D

My question still is, how can I stop it doing that?

EDIT: With my solution (first post), I cannot use my escape key anymore because my script now catches it -,-

Here's what you do:

If this is the original script:

HotKeySet("{ESC}","Quit") ;Press ESC key to quit

While True      ;Here start main loop
    Sleep(20)
WEnd

Func Quit()
    Exit
EndFunc

Then here it is without stopping on escape:

While True      ;Here start main loop
    Sleep(20)
WEnd

Simple.

Edit: Are you using a GUI? If so, then you must call this method to stop it exiting on escape: AutoItSetOption("GUICloseOnESC")

Edited by Manadar
  • 1 year later...
Posted

Here's what you do:

If this is the original script:

HotKeySet("{ESC}","Quit") ;Press ESC key to quit

While True      ;Here start main loop
    Sleep(20)
WEnd

Func Quit()
    Exit
EndFunc

Then here it is without stopping on escape:

While True      ;Here start main loop
    Sleep(20)
WEnd

Simple.

Edit: Are you using a GUI? If so, then you must call this method to stop it exiting on escape: AutoItSetOption("GUICloseOnESC")

I know this is an old topic, but it's what shows up on Google Search still, and the answer is not complete..

I want to complete it for other people who might find this in search.

You are not a very nice helper BTW!

Anyways you need to set it like so-

AutoItSetOption("GUICloseOnESC", 0)

Posted

I know this is an old topic, but it's what shows up on Google Search still, and the answer is not complete..

I want to complete it for other people who might find this in search.

You are not a very nice helper BTW!

Yeah, he is a phony.

Thank you for providing the solution for the rest of us in need.

♡♡♡

.

eMyvnE

  • 8 years later...

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
  • Recently Browsing   0 members

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