| View previous topic :: View next topic |
| Author |
Message |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sun Mar 09, 2008 2:38 pm Post subject: [HELP PLEASE] Hotkeys in Delphi |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Mar 09, 2008 2:42 pm Post subject: |
|
|
if odd(GetAsyncKeyState(Hotkey1.Hotkey)) AND (or w/e Delphi uses for and) odd(GetAsyncKeyState(Hotkey2.Hotkey)) then
_________________
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sun Mar 09, 2008 2:47 pm Post subject: |
|
|
| I mean, if you got only 1 hotkey thing, and in there make it "Ctrl+A", and not using 2 Hotkeys...
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sun Mar 09, 2008 3:26 pm Post subject: |
|
|
No, you have to use AND.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
Michel Expert Cheater
Reputation: 0
Joined: 16 May 2007 Posts: 214 Location: The Netherlands
|
Posted: Sun Mar 09, 2008 3:30 pm Post subject: |
|
|
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 |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Mon Mar 10, 2008 8:02 am Post subject: |
|
|
| but i would still like to know, how do you do that, whith a HotKey object?
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Mon Mar 10, 2008 9:38 am Post subject: |
|
|
Yay, that was more what i needed , 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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Tue Mar 11, 2008 6:14 am Post subject: |
|
|
Try this: | Code: | | RegisterHotKey(handle,1,MOD_ALT,$41); |
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Tue Mar 11, 2008 11:39 am Post subject: |
|
|
| 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
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Thu Mar 13, 2008 8:07 am Post subject: |
|
|
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 |
|
 |
|