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 


[HELP PLEASE] Hotkeys in Delphi

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

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sun Mar 09, 2008 2:38 pm    Post subject: [HELP PLEASE] Hotkeys in Delphi Reply with quote

Well, i would like to know, how to use the THotKey things in delphi the right way

i know you can add:


Quote:
if odd(GetAsyncKeyState(HotKey1.HotKey)) then


to a timer, but what about when you would like to make hotkeys like "Ctrl + A" or something like that?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 09, 2008 2:42 pm    Post subject: Reply with quote

if odd(GetAsyncKeyState(Hotkey1.Hotkey)) AND (or w/e Delphi uses for and) odd(GetAsyncKeyState(Hotkey2.Hotkey)) then
_________________
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sun Mar 09, 2008 2:47 pm    Post subject: Reply with quote

I mean, if you got only 1 hotkey thing, and in there make it "Ctrl+A", and not using 2 Hotkeys...
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sun Mar 09, 2008 3:26 pm    Post subject: Reply with quote

No, you have to use AND.
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Michel
Expert Cheater
Reputation: 0

Joined: 16 May 2007
Posts: 214
Location: The Netherlands

PostPosted: Sun Mar 09, 2008 3:30 pm    Post subject: Reply with quote

I had some problems iwth GC loggin in, so I`ll help you here..
This is what works for me, you can probably do it much easier but yea..

Code:
var
r : integer ;
b : integer;
begin
r := VK_F5;
b := VK_tab;
if odd(GetAsyncKeyState(r)
)then
if odd(GetAsyncKeyState(b))
then
close;
end;

end.


this

Code:


begin

if odd(GetAsyncKeyState(VK_F1)
)then
if odd(GetAsyncKeyState(VK_tab))
then
close;
end;

end.

didnt work for some reason.. or did I miss sth..

EDIT: it actually does... I pressed the wrong button -_-
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Mon Mar 10, 2008 8:02 am    Post subject: Reply with quote

but i would still like to know, how do you do that, whith a HotKey object?
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Mar 10, 2008 9:17 am    Post subject: Reply with quote

RegisterHotKey
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Mon Mar 10, 2008 9:38 am    Post subject: Reply with quote

HolyBlah wrote:
RegisterHotKey


Yay, that was more what i needed Razz, but it still dont work perfectly... I can get it to work with 1 single key, but i cant get it to work with "Alt+A"...
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Mar 10, 2008 12:11 pm    Post subject: Reply with quote

http://msdn2.microsoft.com/en-us/library/ms646309(VS.85).aspx

edit: I didn't even realize the other link redirected to this because it took so long. Look at the 3rd parameter.
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Tue Mar 11, 2008 6:14 am    Post subject: Reply with quote

Try this:
Code:
RegisterHotKey(handle,1,MOD_ALT,$41);
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Tue Mar 11, 2008 11:39 am    Post subject: Reply with quote

HolyBlah wrote:
Try this:
Code:
RegisterHotKey(handle,1,MOD_ALT,$41);


yea, i know that will work, thats what im currently using!, but my question is once again:

if i add an HotKey object to my form (THotKey), and sets the hotkey to "Alt+A", how do i do it?!?!?

edit:
omg, i think i did it!!!:
if registerHotkey(handle,0,
hotkeys1.HotKey.GetModifiers,hotkeys1.HotKey.Key) then
yaaat Very Happy
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Thu Mar 13, 2008 8:07 am    Post subject: Reply with quote

nononononononon!!!!

RegeisterHotkey procedure not working like that.

When your hot key pressed its senned a WM_HOTKEY message to your given handle. Look in this example.
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