프로그램을 하다보면... 조합키가 이벤트를 처리해야 할때가 있다..
Alt키나.. Ctrl키같은 것들..

보통 일반키들은... Key 인자를 받아서 처리하면 된다..
Return --> if(Key == VK_RETURN) ....

Ctrl키를 사용 할 경우에는
if(Shift.Contains(ssCtrl)) ..
else if(Shift.Contains(ssAlt) ) ..  Alt키...

즉.... if(Shift == ssAlt)가 아니다... 이것때문에 괜히 고생...(모르는게 죄다...)

=======================================================================================================
Classes.TShiftState Type

TShiftState indicates the state of the Alt, Ctrl, and Shift keys and the mouse buttons.

Pascal
TShiftState = set of (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble);
C++
(ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble) TShiftState;
File

Classes

The TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurs. It is a set of flags that indicate the following:

Value
Meaning



ssShift  
The Shift key is held down.  



ssAlt  
The Alt key is held down.  



ssCtrl  
The Ctrl key is held down.  



ssLeft  
The left mouse button is held down.  



ssMiddle  
The middle mouse button is held down.  



ssDouble  
The mouse was double-clicked.  






+ Recent posts