Question[Help]Hotkeys

Posts 1–15 of 29 · Page 1 of 2
[Help]Hotkeys
yes.. aggain

[PHP]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F5)
If hotkey1 = True Then
Hotkey.Start()
Dim hotkey2 As Boolean
hotkey2 = GetAsyncKeyState(Keys.F6)
If hotkey2 = True Then
Hotkey.Stop()
End If
End If
End Sub[/PHP]

when i press f6 timer1 (hotkey) doesn't stop! WHY?
Quote Originally Posted by /b/oss View Post
yes.. aggain

[PHP]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F5)
If hotkey1 = True Then
Hotkey.Start()
Dim hotkey2 As Boolean
hotkey2 = GetAsyncKeyState(Keys.F6)
If hotkey2 = True Then
Hotkey.Stop()
End If
End If
End Sub[/PHP]

when i press f6 timer1 (hotkey) doesn't stop! WHY?

Change it to this

[php]
dim hotkey1, hotkey2 as Boolean

hotkey1 = GetAsyncKeyState(Keys.F5)
hotkey2 = GetAsyncKeyState(Keys.F6)

If hotkey1 = True then

hotkey.start()

Elseif hotkey2 = True then

hotkey.stop()

Endif
[/php]

Should work tell me if it doesn't
Quote Originally Posted by /b/oss View Post
yes.. aggain

[PHP]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F5)
If hotkey1 = True Then
Hotkey.Start()
Dim hotkey2 As Boolean
hotkey2 = GetAsyncKeyState(Keys.F6)
If hotkey2 = True Then
Hotkey.Stop()
End If
End If
End Sub[/PHP]

when i press f6 timer1 (hotkey) doesn't stop! WHY?
[php]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkey.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F5)

Dim hotkey2 As Boolean
hotkey2 = GetAsyncKeyState(Keys.F6)

If hotkey1 = True Then
Hotkey.Start()
elseif hotkey2=true then
hotkey.stop()
End If
End Sub
[/php]
Both your solutions should work?
Quote Originally Posted by Invidus View Post
Both your solutions should work?
They're both exactly the same haha, cept we declared our variables slightly different.

They "will" work and if they don't, it's not our fault
Quote Originally Posted by Jason View Post
They're both exactly the same haha, cept we declared our variables slightly different.

They "will" work and if they don't, it's not our fault
doesn't -.-
EDIT: Were you born stupid? This code is turning the timer OFF...how the fuck can it check for keypress if you've just turned it off...

Quote Originally Posted by m_t_h
[php]Handles Hotkey.Tick[/php]

If you turn Hotkey off with F6, and it's the timer controlling what happens when keys are pressed, ofc nothing will happen
Quote Originally Posted by Jason View Post
EDIT: Were you born stupid? This code is turning the timer OFF...how the fuck can it check for keypress if you've just turned it off...




If you turn Hotkey off with F6, and it's the timer controlling what happens when keys are pressed, ofc nothing will happen
im not that stupid -.-
Quote Originally Posted by /b/oss View Post


doesn't -.-
[php]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkeys.Tick
Dim hotkey1 As Boolean
hotkey1 = GetAsyncKeyState(Keys.F5)

Dim hotkey2 As Boolean
hotkey2 = GetAsyncKeyState(Keys.F6)

If hotkey1 = True Then
Hotkeys.Start()
elseif hotkey2=true then
hotkeys.stop()
End If
End Sub [/php]

Take this !! *Sigh*

[IMG]http://womenonthefence.files.*********.com/2009/09_woman.jpg[/IMG]
Quote Originally Posted by /b/oss View Post


im not that stupid -.-
And yet your post is living proof.

You're adding code to the timer named "Hotkey" when you press F6 the timer named "Hotkey" is turned off and therefore anything contained within it is null and void. Make another timer, call it Hotkeys NOT hotkey then add our code to it.
Quote Originally Posted by /b/oss View Post


doesn't -.-

Enable = true
interval = 1

[php]Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkey.Tick
Dim Hotkey As Boolean = GetAsyncKeyState(Keys.F5)
Dim hotkey1 As Boolean = GetAsyncKeyState(Keys.F6)

If hotkey = True Then
Hotkey.Start()
End if

If hotkey2 = True Then
Hotkey.Stop()
End If



End Sub

Are you on 64bit?[/php]
"should".. brb
still; when i press f6 is ok: it stopps but when i press f5 to start it doesn't work
still same... f5 doesn't work! ( the start)
Quote Originally Posted by /b/oss View Post
still same... f5 doesn't work! ( the start)
Read my post -.-
you really do have some logical problems...
Posts 1–15 of 29 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?