GetShiftState function
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
function GetShiftState: TShiftState;  

Description
The GetShiftState function returns current state for shift keys (Shift, Ctrl, Alt).  

Original code
function GetShiftState: TShiftState;  
begin  
  Result := [];  
  if GetKeyState(VK_SHIFT) < 0 then Include(Result, ssShift);  
  if GetKeyState(VK_CONTROL) < 0 then Include(Result, ssCtrl);  
  if GetKeyState(VK_MENU) < 0 then Include(Result, ssAlt);  
end;