프로그램을 하다보면... 조합키가 이벤트를 처리해야 할때가 있다..
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
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. |
'1.소프트웨어 이야기 > 00.VCL(C++ Builder, Delphi)' 카테고리의 다른 글
가끔씩 하는 RAD Studio 스플래쉬 바꾸기.. (1) | 2008.01.11 |
---|---|
[팁]W8057이 보기 싫을때.. (0) | 2008.01.10 |
[펌]VirtualTreeView 사용법 - 4 (0) | 2008.01.03 |