| View previous topic :: View next topic |
| Author |
Message |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Tue Jul 24, 2007 7:17 am Post subject: [Tut] --{Setting Hotkeys in Delphi}-- [/Tut] |
|
|
I posted this, because many ppl have asked how to do this.. Feel free to flame me oO
{im using delphi 7}
To start off launch delphi and make a new form.
Drop some buttons & panels and what ever you want. Rename the form, change the BGcolor, etc.
Next click the "system" tab, and drop a timer on to ur form (it looks like a white clock), place it anywhere u want (it really doesnt matter).
Click the timer, go to "events" in the "Object Inspector".
Next double clcik the timer, the code page should open up. Put this code there:
| Quote: |
if odd(GetAsyncKeyState (VK_RETURN)) then //RETURN = Enter Key
begin
button1.click; //This is the thing we made a hotkey for
end; |
In this example I made a hotkey for the button1.click function = when enter is pressed, the program does the same thing as when button 1 is clicked. You can change the "button1.click" and the "RETURN" part to whatever you like, this is just an example, google "virtual keys" if u want to set the hotkey to something else. (F1-F12 = F1-F12 buttons)
Hope this helped
~Skylla~ _________________
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Tue Jul 24, 2007 7:44 am Post subject: |
|
|
w00t w00t I use the same way
nice tut
btw Delphi 7 owns |
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Tue Jul 24, 2007 7:49 am Post subject: |
|
|
| rEakW0n wrote: | w00t w00t I use the same way
nice tut
btw Delphi 7 owns |
Agreed!!!
Yay, today 1 of my posts was stickied!!! check the stickies (in this section)
Kevin tought me this  _________________
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Jul 24, 2007 7:53 am Post subject: |
|
|
Nice tut, I just hope you don't get repped for this since everyone has been requested and answered and most people should know how to do it. But still great tut. D7SE OWNS D7 _________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Tue Jul 24, 2007 7:55 am Post subject: |
|
|
A GetAsyncKeyState tutorial!? AWESOME!!!! Sign my complier please. _________________
|
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Tue Jul 24, 2007 7:58 am Post subject: |
|
|
D7SE, i have it! _________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Tue Jul 24, 2007 7:59 am Post subject: |
|
|
nice even that i know it...
can i do call function of button1? and how do i call functions on delphi i havent learned it yet... |
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Tue Jul 24, 2007 8:02 am Post subject: |
|
|
| Symbol wrote: | nice even that i know it...
can i do call function of button1? and how do i call functions on delphi i havent learned it yet... |
hmm im not sure, but i think u can... You should ask Renkokuken/appalsap they know... _________________
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Tue Jul 24, 2007 8:11 am Post subject: |
|
|
| skyllakarean wrote: | | rEakW0n wrote: | w00t w00t I use the same way
nice tut
btw Delphi 7 owns |
Agreed!!!
Yay, today 1 of my posts was stickied!!! check the stickies (in this section)
Kevin tought me this  |
hah ye, np. also great tutorial, even though it isnt so hard to get when its plain text. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue Jul 24, 2007 1:59 pm Post subject: |
|
|
| Totally redundant when you're using delphi. In delphi, it already sets up a keyboard hook and a mouse hook so you can respond to any sets of keys you choose, this is why you get KeyUp and KeyDown notifications, use those instead. |
|
| Back to top |
|
 |
Lorrenzo Moderator
Reputation: 4
Joined: 02 Jun 2006 Posts: 3744
|
Posted: Tue Jul 24, 2007 8:34 pm Post subject: |
|
|
what if you wanna use like
_________________
LAWLrrenzolicious |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Tue Jul 24, 2007 8:54 pm Post subject: |
|
|
if keybd_event(keyeventf_ctrldown,0,0,0,0) then
if keybd_event(VK_F1,0,0) then
bla bla
bla bla
end; |
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Jul 25, 2007 5:26 am Post subject: |
|
|
| Symbol wrote: | if keybd_event(keyeventf_ctrldown,0,0,0,0) then
if keybd_event(VK_F1,0,0) then
bla bla
bla bla
end; |
lol you cant use "then" twice. |
|
| Back to top |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Wed Jul 25, 2007 6:11 am Post subject: |
|
|
| Symbol wrote: |
begin
if keybd_event(keyeventf_ctrldown,0,0,0,0) and
if keybd_event(VK_F1,0,0) then
begin
bla bla
bla bla
end;
end; |
I corrected his code  _________________
|
|
| Back to top |
|
 |
iRiot Master Cheater
Reputation: 0
Joined: 03 Jul 2007 Posts: 395 Location: Aka RIOT
|
Posted: Wed Jul 25, 2007 10:04 pm Post subject: |
|
|
also u can do this
| Code: | If odd(GetAsyncKeyState(65)) Then
begin
//What ever u want it to do |
just erase the VK_ and put in 65 the 65 stands for A heres a list of Letters
| Code: | 65 - A
66 - B
67 - C
68 - D
69 - E
70 - F
71 - G
72 - H
73 - I
74 - J
75 - K
76 - L
77 - M
78 - N
79 - O
80 - P
81 - Q
82 - R
83 - S
84 - T
85 - U
86 - V
87 - W
88 - X
89 - Y
90 - Z |
Oh yeah btw the Ctrl+ doesn't work u get a error so any1 mind fixing it? i tried a couple of stuff nothing worked
| Quote: | begin
if keybd_event(keyeventf_ctrldown,0,0,0,0) and
if keybd_event(VK_F1,0,0) then
begin
bla bla
bla bla
end;
end; |
[Error] Unit1.pas(2 : Undeclared identifier: 'keyeventf_ctrldown' _________________
|
|
| Back to top |
|
 |
|