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 


check which key pressed

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

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sun Jan 27, 2008 8:35 am    Post subject: check which key pressed Reply with quote

i was wondering if anyone knew how to check if a key is begin pressed in delphi, so say i press a button and it waits for a key to be pressed, and then it records it to a variable
_________________
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sun Jan 27, 2008 8:52 am    Post subject: Reply with quote

if odd(GetAsyncKeyState(VK_F1)) then
//code

checks if F1 is pressed

useally used in TTimer
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Jan 28, 2008 12:18 am    Post subject: Reply with quote

what i need to do is have a timer that waits for any key to be pressed so it can record
_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Jan 28, 2008 12:53 am    Post subject: Reply with quote

RegisterHotkey and then handle WM_HOTKEY messages.
_________________
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Jan 28, 2008 8:45 am    Post subject: Reply with quote

Try this:
Code:

  for I := 0 to $255 do
    if odd(GetAsyncKeyState(i)) then
    begin
      {Code here...}
    end;
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Mon Jan 28, 2008 2:28 pm    Post subject: Reply with quote

wndproc? Oo
_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Jan 28, 2008 6:21 pm    Post subject: Reply with quote

HolyBlah wrote:
Try this:
Code:

  for I := 0 to $255 do
    if odd(GetAsyncKeyState(i)) then
    begin
      {Code here...}
    end;

Registering hotkeys is much better.

_________________
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Mon Jan 28, 2008 6:30 pm    Post subject: Reply with quote

sponge wrote:
Registering hotkeys is much better.


Yes but he wants to record a key.
So would have to register all keys then.
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Jan 28, 2008 7:44 pm    Post subject: Reply with quote

oh nvm then. the first part stated that he wnated to know if a key was being pressed.
_________________
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