Jump to content

Hotkey inside loop and GUI


Archon
 Share

Recommended Posts

I have a problem. I made GUI, after clicking on its butto is called function with loop. I want to stop this loop by CRTL+w. Loop is working and sounds beep aftec hitting key. Who can tell me why this don't work?

Global $WyjdzPetla=0

HotKeySet ("w","_wyjscie_z_petli")

Func wewnetrzna()
    
    Local $czas,$plik,$x,$y
    
    $plik=FileOpen("tab.txt",1)
    
    While ($WyjdzPetla=0)
    
    $czas=TimerInit()
    OdczytMini()
    $czas=Round(TimerDiff($czas))
    
    FileWrite($plik, $czas & @CRLF)
    For $x=0 To 278 Step 1
        For $y=0 To 221 Step 1
            FileWrite($plik, $MiniMapa[$x][$y])
        Next
        FileWrite($plik, @CRLF)
    Next
    Sleep(100)
    WEnd
    FileClose($plik)

    $WyjdzPetla=0

EndFunc

Func _wyjscie_z_petli()
    
    $WyjdzPetla = 1
    
EndFunc
Link to comment
Share on other sites

yes, you right but none hotkey works. Alone 'a' or CRTL+a It doesn't matter :( Problem still exist.

Edit: I've just found my mistake, external program was blocking in some way all keys :mellow: Anyway, thx.

Edited by Archon
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...