HomeCalendarGalleryFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 [TUT] Global Hotkeys!

View previous topic View next topic Go down 
AuthorMessage
CookiEâ„¢
Admin
Admin
avatar

Posts : 42
Points : 27747
Reputation : 3
Join date : 2010-06-26
Location : Netherlands

PostSubject: [TUT] Global Hotkeys!   13/7/2010, 18:41

Hey guys well im gonna show you how to create Global Hotkeys!
You can use Global Hotkeys for ingame features!
Well first you need to start a new project!

Follow my steps:

First declare this:

Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Now what our program does is check frequently whether the keys we want are being pressed.

So for this we need a timer.

Add a timer, and add this code to the Form1_Load event.

Code:
Timer1.enabled = true
Timer1.interval = 1

This is just turning on the Timer and setting its interval to 1.

Now, it depends on how many keys you want to press in order for your function to initiate.

Say, you want Them to press Shift.

You'll need to declare a boolean for shift like so:

Code:
Dim Shiftkey as Boolean
When that is done we need to set the value of the booleans. This is the part where the keys that need to be pressed are specified.

Add this code under the one previous.
Code:
Shiftkey = GetAsyncKeyState(Keys.ShiftKey)

Now we use an If statement to check if the keys are down.

Code:
If Shiftkey = True Then
'Put the code of what you want to happen when Shift is pressed here.
End If

I hope you learned from this tutorial, and remember not to copy and paste!
Type it up so you LEARN.

_________________
Back to top Go down
View user profile http://cdssys.boardlog.com
 
[TUT] Global Hotkeys!
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Lace Mamba Global to Publish Lucius
» Counter -Strike Global Offensive
» Missing Dementation 3-5 / Hotkeys problem
» SWTOR hotkeys, mapping and controller
» What are your hotkeys?

Permissions in this forum:You cannot reply to topics in this forum
CDSsys :: Programming :: .NET (C#, VB8)-
Jump to: