1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
var
Input:TInput;
begin
Input.Itype := INPUT_KEYBOARD;
Input.ki.wVk := VK_CONTROL;
Input.ki.wScan := 0;
Input.ki.time := 0;
Input.ki.dwExtraInfo := 0;
Input.ki.dwFlags := 0; // Preparation pour envoi Key DOWN
SendInput(1, Input, SizeOf(Input)); //Send Key DOWN
//Lecture de l'etat de VK_CONTROL
if GetAsyncKeyState(VK_CONTROL) <> 0 then
begin
//Vk_Control est down! remet a UP!
Input.ki.dwFlags := KEYEVENTF_KEYUP; // preparation pour envoi Key UP
SendInput(1, Input, SizeOf(Input)); //Send Key UP
end; |
Partager