Unit 'Forms' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

KeysToShiftState

Converts modifier keys in the LParam for a mouse message to a TShiftState value.

Declaration

Source position: forms.pp line 1939

function KeysToShiftState(

  Keys: PtrUInt

):TShiftState;

Arguments

Keys

  

Pointer to an unsigned Integer with the mouse key states examined in the routine.

Function result

Set type with the TShiftStateEnum values representing the specified Keys.

Description

KeysToShiftState returns a TShiftState type with the TShiftStateEnum values needed to represent the mouse key states in the Keys argument. KeysToShiftState ANDs the value in Keys with RTL mouse key constants to determine the values in the set, including:

MK_Shift
Includes ssShift for a non-zero result.
MK_Control
Includes ssCtrl for a non-zero result.
MK_LButton
Includes ssLeft for a non-zero result.
MK_RButton
Includes ssRight for a non-zero result.
MK_MButton
Includes ssMiddle for a non-zero result.
MK_XBUTTON1
Includes ssExtra1 for a non-zero result.
MK_XBUTTON2
Includes ssExtra2 for a non-zero result.
MK_DOUBLECLICK
Includes ssDouble for a non-zero result.
MK_TRIPLECLICK
Includes ssTriple for a non-zero result.
MK_QUADCLICK
Includes ssQuad for a non-zero result.

GetKeyState is also called, and the following virtual key codes are processed for the return value:

VK_MENU
Includes ssAlt when the result is a negative number.
VK_LWIN, VK_RWIN
Includes ssMeta when the result is a negative number.

KeysToShiftState is used to translate the key values for mouse messages in methods like DoMouseDown, DoMouseUp, and WMMouseMove in TControl.

See also

ShiftStateToKeys

  

Converts a shift state into a key state value compatible with the key state of a Windows API LParam.

KeyDataToShiftState

  

Converts modifier keys from the LParam in a keyboard message (WM_KEYUP for example) to a TShiftState value.

TShiftState

MK_SHIFT

  

MK_CONTROL

  

MK_LBUTTON

  

MK_RBUTTON

  

MK_MBUTTON

  

MK_XBUTTON1

  

MK_XBUTTON2

  



CT Web help

CodeTyphon Studio