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 


Delphi Keystrokes - 1 blocks the other key >.<

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sat Aug 18, 2007 9:03 pm    Post subject: Delphi Keystrokes - 1 blocks the other key >.< Reply with quote

im trying to do like when im pressing left and down at the same time so ill get both events...
i got 4 events (left arrow, right, up and down) if i press 1 it works normaly but if i press 2 it only works for 1...
i already googled it and best thing i found was GetKeyState which will start/stop on key press...
couldnt figure out how to use onKeyDown or press or w/e...
any suggestions?
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sat Aug 18, 2007 11:13 pm    Post subject: Reply with quote

hmm you mean when you press exampel left arrow then move object to left and the other arrows ?

but if you whant to go exampel up+right it wont work =/



if Odd(GetAsyncKeyState(VK_RIGHT+VK_Left)) then // if this dosent work do exampel 2
begin
object.left:=object.left+10;
object.top:=object.top+10;
end;end;


if Odd(GetAsyncKeyState(hotkey1.hotkey)) then //you can find a hotkey box and the write hotkey there
begin
object.left:=object.left+10;
object.top:=object.top+10;
end;end;

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Aug 19, 2007 12:14 am    Post subject: Reply with quote

i don't understand ur 2nd method O_o
1st doesnt work, u can complie but doesnt do anything instearsing...
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Aug 19, 2007 1:00 am    Post subject: Reply with quote

well this 1 working for me but it is a little bugging you have to press the left+top at the same time or you will only go 1 line

Quote:


procedure TForm1.HotKeyCheckTimer(Sender: TObject);
begin
//left
if Odd(GetAsyncKeyState(VK_Left)) then
object1.left:=object1.left-10;
//right
if Odd(GetAsyncKeyState(VK_right)) then
object1.left:=object1.left+10;
//up
if Odd(GetAsyncKeyState(VK_up)) then
object1.top:=object1.top-10;
//Down
if Odd(GetAsyncKeyState(VK_Down)) then
object1.top:=object1.top+10;
//right + top
if Odd(GetAsyncKeyState(VK_RIGHT+VK_up)) then
begin
object1.top:=object1.top-10;
object1.left:=object1.left+10;
end;
//left + top
if Odd(GetAsyncKeyState(VK_left+VK_up)) then
begin
object1.top:=object1.top-10;
object1.left:=object1.left-10;
end;
//right + bottom
if Odd(GetAsyncKeyState(VK_RIGHT+VK_down)) then
begin
object1.top:=object1.top+10;
object1.left:=object1.left+10;
end;
//left + bottom
if Odd(GetAsyncKeyState(VK_left+VK_down)) then
begin
object1.top:=object1.top+10;
object1.left:=object1.left-10;
end;


end;

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Aug 19, 2007 5:14 am    Post subject: Reply with quote

well still doesnt work....
doesnt matter now, i cant make my label incrase by 1 every keypress...
i tried

Label1.Caption := +1, IntToStr(+1) and Label1.Caption+IntToStr(1) or +1;

lets say its 10
so it changes to 1 or 101 i cant get it work... whats the problem?
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Aug 19, 2007 8:22 am    Post subject: Reply with quote

...
Label1.Caption := IntToStr(StrToInt(Label1.Caption)+1);

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Aug 19, 2007 11:32 am    Post subject: Reply with quote

nog_lorp wrote:
...
Label1.Caption := IntToStr(StrToInt(Label1.Caption)+1);



or


var
LOL:integer;
begin
LOL:= label1.caption +1;
label1.Caption := IntToStr(LOL);

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Aug 19, 2007 12:23 pm    Post subject: Reply with quote

i thought about that O_o
i think i tried it and it didnt worked... dont remember ill try nog_lorps method

edit:
yea it works Very Happy
i should have known i used inttostr on a label i needed the strtoint before =)
thanks
Back to top
View user's profile Send private message
MadDoom
Cheater
Reputation: 0

Joined: 27 Dec 2006
Posts: 38

PostPosted: Sun Aug 19, 2007 12:26 pm    Post subject: Reply with quote

nog_lorp wrote:

var
LOL:integer;
begin
LOL:= label1.caption +1;
label1.Caption := IntToStr(LOL);

its will not work. you cant add a number to a string...
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Aug 19, 2007 12:36 pm    Post subject: Reply with quote

MadDoom wrote:
nog_lorp wrote:

var
LOL:integer;
begin
LOL:= label1.caption +1;
label1.Caption := IntToStr(LOL);

its will not work. you cant add a number to a string...



lol my foult xD
Quote:

var
LOL:integer;
begin
LOL:= label1.caption +1;
label1.Caption := strtoint(LOL);

_________________
dont complain about my english...
1*1 = 2?
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