The state of the Shift, Ctrl, Alt keys
The following functions can be used to check if the Shift, Ctrl or Alt key(s) are pressed...
~~~~~~~~~~~~~~~~~~~~~~~~~
function CtrlDown : Boolean;
var
State : TKeyboardState;
begin
GetKeyboardState(State) ;
Result := ((State[vk_Control] And 128) <> 0) ;
end;
function ShiftDown : Boolean;
var
State : TKeyboardState;
begin
GetKeyboardState(State) ;
Result := ((State[vk_Shift] and 128) <> 0) ;
end;
function AltDown : Boolean;
var
State : TKeyboardState;
begin
GetKeyboardState(State) ;
Result := ((State[vk_Menu] and 128) <> 0) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» Hide a Process in the 'Close Program' Window
« Path shortener: c:\AB\C...DE\F.ghi