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 .
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 .
Because i was under direct entirment . so i can't use keybd_event .
What is direct entirement?
Dominik
Dominik
like some famous games . such as Final Fanacy.....
And that game cannot be controlled using keydb_event !? Strange things....
yes , sir . many games cannot be controlled with Keybd_event .
anyone help me ?
thanx.
anyone help me ?
thanx.