Sign in Join
FPDoc Onlineexperiment

KeyboardStateToShiftState function

In unit Forms

Converts virtual key state codes to TShiftState values.

Declaration

pascal
function KeyboardStateToShiftState: TShiftState

Function result

Set type with the TShiftStateEnum values representing the current key states.

Description

Calls GetKeyState to get the virtual key codes for the following:

  • VK_SHIFT
  • VK_CONTROL
  • VK_MENU
  • VK_LWIN
  • VK_RWIN

The return value is a set type with the TShiftState values corresponding to the virtual key codes. It may be an empty set when none of the virtual keys are detected.

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