Sign in to follow this  
Followers 0
Archon

Hotkey inside loop and GUI

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Shouldn't it be

HotKeySet ("^w","_wyjscie_z_petli")
for CTRL+w, instead of

HotKeySet ("w","_wyjscie_z_petli")
?

The help shows an example of different keys combination:

HotKeySet("+!d", "ShowMessage")  ;Shift-Alt-d
Edited by Akshay07

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

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