Hi
I use SendInput function to synthesizes keystrokes . and i can let the keyboard be Pressed . but i can't let the key be released after being pressed.

the code below is the function i written:

procedure RelKey(wVK : WORD; wSanCode :WORD);
var
aInput:array[0..3] of TINPUT ;
UpKey : TINPUT ;
begin // aInput[0] , aInput[1] press key, aInput[2] aInput[3] release key

aInput[0].ki.wVk := wVK;
aInput[0].ki.wScan := wSanCode;
aInput[0].Itype:= INPUT_KEYBOARD;
aInput[0].ki.dwExtraInfo:=0;
aInput[0].ki.dwFlags:=KEYEVENTF_EXTENDEDKEY;
aInput[0].ki.time :=0;

aInput[1].ki.wVk := wVK;
aInput[1].ki.wScan := wSanCode;
aInput[1].Itype:= INPUT_KEYBOARD;
aInput[1].ki.dwExtraInfo:=0;
aInput[1].ki.dwFlags:=KEYEVENTF_EXTENDEDKEY;
aInput[1].ki.time :=GetTickCount();

aInput[2].ki.wVk := wVK;
aInput[2].ki.wScan := wSanCode;
aInput[2].Itype:= INPUT_KEYBOARD;
aInput[2].ki.dwExtraInfo:=0;
aInput[2].ki.dwFlags:=KEYEVENTF_KEYUP;
aInput[2].ki.time :=GetTickCount();

aInput[3].ki.wVk := wVK;
aInput[3].ki.wScan := wSanCode;
aInput[3].Itype:= INPUT_KEYBOARD;
aInput[3].ki.dwExtraInfo:=0;
aInput[3].ki.dwFlags:=KEYEVENTF_KEYUP;
aInput[3].ki.time :=GetTickCount();
asm
push $1c ;
lea eax, ; //here is a pointer to aInput
push eax ;
push 1 ;
call SendInput;
end;


end;

i just want the key to be released after being pressed .

PS: i have used keybd_event and postmessage .and can't do that yet

Thanx for all .
Posted on 2004-10-15 10:13:28 by nbw
Because i was under direct entirment . so i can't use keybd_event .
Posted on 2004-10-15 10:14:24 by nbw
What is direct entirement?
Dominik
Posted on 2004-10-15 10:29:16 by Dom
like some famous games . such as Final Fanacy.....
Posted on 2004-10-15 10:34:42 by nbw
And that game cannot be controlled using keydb_event !? Strange things....
Posted on 2004-10-15 13:53:19 by Dom
yes , sir . many games cannot be controlled with Keybd_event .

anyone help me ?

thanx.
Posted on 2004-10-15 15:22:44 by nbw