timebomb99 (12-22-2009)
Can someone help me with hotkeys?
I can never get them to work.
I want to make a hotkey that i can use in-game!
Please someone help me..
Thanks
acid_buRn
timebomb99 (12-22-2009)
They used to not work for me either, but then I now have 2 OS's on my PC, cause my first 1 got fked up by AleinWare, and now it works, I had
Windows XP Home,
Now I have Windows XP Professional
I will make a tutorial on it in a second
Needed:
- A Timer
- A Label (For testing if it works)
Code:
Put this under "Public Class *****"
Then add this code to your timer:Code:Public Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer
Code:Dim HotkeyTrue as Boolean HotkeyTrue = GetAsyncKeyState(Keys.F12) 'F12 is the hotkey If HotkeyTrue = true Then Label1.Text = "True" End ifExtra:Code:Dim HotkeyFalse as Boolean HotkeyFalse = GetAsyncKeyState(Keys.F11) 'F11 is the hotkey If HotkeyFalse = True Then Label1.Text = "False" End if
Enable the timer for the hotkeys.
Set the interval for the hotkeys to 15 millseconds (To prevent lag)
Code tested by me and it works.
ac1d_buRn (10-24-2009),timebomb99 (12-22-2009)
timebomb99 (12-22-2009)
Why doesn't this work:
Code:Public Class Form1 Public Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Long) As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim Hotkeyf12, hotkeyq As Boolean Dim counter As Integer Hotkeyf12 = GetAsyncKeyState(Keys.F12) 'F12 is the hotkey hotkeyq = GetAsyncKeyState(Keys.Q) If Hotkeyf12 = True Then counter = (counter + 1) Label1.Text = Str(counter) Else counter = counter End If If hotkeyq = True Then Close() End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim counter As Integer = 0 Label1.Text = Str(counter) Timer1.Enabled = True End Sub End Class
Posts:
10 posts []
50 posts []
100 posts []
500 posts []
Thanks:
5 thanks []
10 thanks []
100 thanks []
Profile:
Make a signature []
Set a profile picture []
Hacks:
Download and use a hack []
Get a virus []
... or two... []
Release my own hacks []
well it was working for the "true" "false" stuff, so i thought it would still work. i normally declare outside too. i'm thinking maybe i'ts going too fast fo my computer? but then again, adding 1 shouldn't take up any memory at all that or somehow it's getting reset to 0 every time
Posts:
10 posts []
50 posts []
100 posts []
500 posts []
Thanks:
5 thanks []
10 thanks []
100 thanks []
Profile:
Make a signature []
Set a profile picture []
Hacks:
Download and use a hack []
Get a virus []
... or two... []
Release my own hacks []