Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How To Add Shortcut Keys To Your Application inVisual Basic?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Womanizer
Grandmaster Cheater
Reputation: 2

Joined: 30 May 2009
Posts: 958

PostPosted: Sun Apr 15, 2012 4:36 am    Post subject: How To Add Shortcut Keys To Your Application inVisual Basic? Reply with quote

I have made already a way to do it if your application is open. But when I go in a game the key doesn't work. Here's my code:
Code:

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.F3 Then
        stuff that you don't want to see.
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        KeyPreview = True
    End Sub
End Class



Would apperciate for a quick answer! Thanks!

Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Apr 15, 2012 5:07 am    Post subject: Reply with quote

'Form1_KeyDown' requires your form to have focus in order for the key to be processed.

You will need to either register a global hotkey, or constantly monitor the keyboard status using an API call such as GetAsyncKeyState.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Womanizer
Grandmaster Cheater
Reputation: 2

Joined: 30 May 2009
Posts: 958

PostPosted: Sun Apr 15, 2012 5:13 am    Post subject: Reply with quote

Wiccaan wrote:
'Form1_KeyDown' requires your form to have focus in order for the key to be processed.

You will need to either register a global hotkey, or constantly monitor the keyboard status using an API call such as GetAsyncKeyState.


Can you give me a code for an example?

edit: nevermind got it to work. thanks anyway

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites