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 


[VB.NET] Hotkeys

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DaNemeziz
Master Cheater
Reputation: 0

Joined: 29 Sep 2007
Posts: 430

PostPosted: Sun Nov 30, 2008 5:33 am    Post subject: [VB.NET] Hotkeys Reply with quote

I have buttons like these ...
Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Enabled = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Enabled = False
    End Sub

... but now I want to make hotkeys which can be pressed while the bot is minimized.
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Sun Nov 30, 2008 5:36 am    Post subject: Reply with quote

RegisterHotkey or make a timer with 50 msec which checks for this:
Code:
if(GetAsyncKeyState([hotkey]){
 // do whatever
}
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Nov 30, 2008 2:31 pm    Post subject: Reply with quote

RegisterHotKey and respond to the WM_HOTKEY message.

or

Create a thread, or timer, and check with GetAsyncKeyState
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Sun Nov 30, 2008 8:46 pm    Post subject: Reply with quote

i would probably do...a background worker. Make sure you know how to multi-thread. sleep with idk i guess 10-500. Yup. That should be good (don't forget the getasync thingy)
_________________
Back to top
View user's profile Send private message AIM Address
Luigi
Grandmaster Cheater Supreme
Reputation: 1

Joined: 24 Mar 2008
Posts: 1082

PostPosted: Sun Nov 30, 2008 10:16 pm    Post subject: Reply with quote

I've tried getanskeystate and registerhotkeys method, both have failed.
I am having this problem too.
Back to top
View user's profile Send private message
FullyAwesome
I post too much
Reputation: 0

Joined: 05 Apr 2007
Posts: 4438
Location: Land Down Under

PostPosted: Mon Dec 01, 2008 3:05 am    Post subject: Reply with quote

i'm presuming you're talking about global hotkeys, not regular old hotkeys. if you are play around with this source i have for a smuggle program for MapleStory. i got the code from a website i checked, and you can change the hotkey by clicking on the label. that's just a little run down on the program. (attached)

i know this probably isn't the best method, but hey it works.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Dec 01, 2008 10:42 am    Post subject: Reply with quote

Luigi wrote:
I've tried getanskeystate and registerhotkeys method, both have failed.
I am having this problem too.


Did you actually run it within a loop / timer? You have to check continually with GetAsyncKeyState

Did you respond to the WM_HOTKEY message for RegisterHotKey?
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