Sign in Join
FPDoc Onlineexperiment

GetKeyShiftState function

In unit Controls

Gets a set of state values for current modifier keys.

Declaration

pascal
function GetKeyShiftState: TShiftState

Function result

Set of Shift state values active for the virtual keys, or an empty set when none of the keys are active.

Description

GetKeyShiftState is a TShiftState function used to get a set with the current state values for modifier keys. GetKeyShiftState calls GetKeyState to capture the values in the set for the following virtual keyboard keys:

VK_CONTROL
Includes ssCtrl when the Control key is pressed
VK_SHIFT
Includes ssShift when the Control key is pressed
VK_MENU
Includes ssAlt when the Alt key is pressed
VK_LWIN or VK_RWIN
Includes ssMeta when one of the WIN keys (or Alt+GR on Mac) is pressed

The return value is an empty set ([]) when none of the virtual keys have a non-zero value.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.