 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
jongwee Moderator
Reputation: 0
Joined: 28 Jun 2006 Posts: 1388 Location: Singapore
|
Posted: Thu Nov 29, 2007 7:07 am Post subject: |
|
|
Hmm... Keybd_event.... Nevertheless, good work.
_________________
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
|
| Back to top |
|
 |
ups2000ups I post too much
Reputation: 0
Joined: 31 Jul 2006 Posts: 2471
|
Posted: Fri Nov 30, 2007 5:24 am Post subject: |
|
|
| rEakW0n wrote: |
oh I forgot to say that this way is in delphi^^ |
or you can simple use sendkeys Oo
| Code: |
procedure SimulateKeyDown(Key : byte);
begin
keybd_event(Key, 0, 0, 0);
end;
procedure SimulateKeyUp(Key : byte);
begin
keybd_event(Key, 0, KEYEVENTF_KEYUP, 0);
end;
procedure SimulateKeystroke(Key : byte;
extra : DWORD);
begin
keybd_event(Key,
extra,
0,
0);
keybd_event(Key,
extra,
KEYEVENTF_KEYUP,
0);
end;
procedure SendKeys(s : string );
var
i : integer;
flag : bool;
w : word;
begin
//Get the state of the caps lock key
flag := not GetKeyState(VK_CAPITAL) and 1 = 0;
//If the caps lock key is on then turn it off
if flag then
SimulateKeystroke(VK_CAPITAL, 0);
for i := 1 to Length(s) do begin
w := VkKeyScan(s[i]);
//If there is not an error in the key translation
if ((HiByte(w) <> $FF) and
(LoByte(w) <> $FF)) then begin
//If the key requires the shift key down - hold it down
if HiByte(w) and 1 = 1 then
SimulateKeyDown(VK_SHIFT);
//Send the VK_KEY
SimulateKeystroke(LoByte(w), 0);
//If the key required the shift key down - release it
if HiByte(w) and 1 = 1 then
SimulateKeyUp(VK_SHIFT);
end;
end;
//if the caps lock key was on at start, turn it back on
if flag then
SimulateKeystroke(VK_CAPITAL, 0);
end;
// send string
SendKeys('Delphi Is RAD!');
|
dosent "keybd_event(VK_RETURN,0,0,0);" only works for windows applications?
(exampel it wont work for Silkroad/maple and stuff include if they dident got GG)
anyway i think
"PostKeyEx32(VK_Return, [], FALSE); "
"PostKeyEx32(ORD('D'), [], FALSE); "
is better
(found it on a swedish site and idk if you can find it somewhere else)
| Code: |
Type
TShiftKeyInfo = Record
shift: Byte;
vkey : Byte;
End;
byteset = Set of 0..7;
Const
shiftkeys: Array [1..3] of TShiftKeyInfo =
((shift: Ord(ssCtrl); vkey: VK_CONTROL ),
(shift: Ord(ssShift); vkey: VK_SHIFT ),
(shift: Ord(ssAlt); vkey: VK_MENU ));
Var
flag: DWORD;
bShift: ByteSet absolute shift;
i: Integer;
Begin
For i := 1 To 3 Do Begin
If shiftkeys[i].shift In bShift Then
keybd_event( shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0), 0, 0);
End; { For }
If specialkey Then
flag := KEYEVENTF_EXTENDEDKEY
Else
flag := 0;
keybd_event( key, MapvirtualKey( key, 0 ), flag, 0 );
flag := flag or KEYEVENTF_KEYUP;
keybd_event( key, MapvirtualKey( key, 0 ), flag, 0 );
For i := 3 DownTo 1 Do Begin
If shiftkeys[i].shift In bShift Then
keybd_event( shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0), KEYEVENTF_KEYUP, 0);
End; { For }
End; //PostKeyEx32 |
_________________
dont complain about my english...
1*1 = 2? |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Fri Nov 30, 2007 12:13 pm Post subject: |
|
|
I know that it doesn't work in Maple or other games with High GG rev.
But this is not for MS.
|
|
| Back to top |
|
 |
|
|
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
|
|