티스토리 뷰

Delphi

procedure KeyPress(var Key: Char); dynamic;

C++

DYNAMIC void __fastcall KeyPress(System::WideChar &Key);

Properties

Type

Visibility

Source

Unit

Parent

procedure

function

protected

Vcl.Controls.pas

Vcl.Controls.hpp

Vcl.Controls

TWinControl

Description

Responds to keyboard input.

When a windowed control receives a key-press message (WM_CHAR) from Windows, its message handler calls the DoKeyPress method.

If DoKeyPress determines that the control should, in fact, process the character, it calls KeyPress, passing the key code in the Key parameter.

KeyPress calls any event handler attached to the OnKeyPress event.

Override KeyPress to provide other responses in addition to the event handler call.

Either KeyPress or the OnKeyPress event handler it calls can suppress further processing of a character by setting the Key parameter to zero.

Note: The Key parameter is the character represented by the key that is pressed, not a Windows virtual key code.

 

키보드 입력에 응답합니다.

창 컨트롤이 Windows에서 키 누르기 메시지 (WM_CHAR)를 받을 때, 메시지 처리기는 DoKeyPress 메서드를 호출합니다.

DoKeyPress 가 컨트롤에서 실제로 문자를 처리해야 한다고 판단하면, KeyPress를 호출하여 Key 매개 변수에 키 코드를 전달합니다.

KeyPressOnKeyPress 이벤트에 첨부된 모든 이벤트 처리기를 호출합니다.

KeyPress를 재정의하여 이벤트 처리기 호출 이외에 다른 응답을 제공합니다.

KeyPress 또는 OnKeyPress 이벤트 핸들러를 호출하면 Key 매개 변수를 0으로 설정하여 문자 처리를 추가로 억제 할 수 있습니다.

참고: Key 매개 변수는 Windows 가상 키 코드가 아닌 누른 키가 나타내는 문자입니다.

 

Example

procedure TMainForm.mmoKeyPress(Sender: TObject; var Key: Char);

begin

  KeyPress(Key);

  ShowMessage('Key: ' + Key);

end;

 

determine 미국식 [dɪ|t3:rmɪn] 

1. 알아내다, 밝히다
2. (
무엇의 방식유형을) 결정하다
3. (
공식적으로) 확정하다

either 미국·영국 [|aɪðə(r);|i:ðə(r)] 

1. (둘 중) 어느 하나()
2. (
두 개) 각각()
3. (
부정문에서) …도 (그렇다)

suppress 미국·영국 [sə|pres] 

1. 진압하다
2. (
인쇄발표 등을) 금하다, (정보 등을) 숨기다
3. (
감정감정 표현을) 참다

further 미국식 [|f3:rðə(r)] 

1. (거리상으로) 더 멀리에
2. (
과거로) 더 거슬러 올라가; (미래로) 더 나아가
3.

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/Vcl.Controls.TWinControl.KeyPress

'프로그래밍 언어 > Delphi' 카테고리의 다른 글

[Reference] System.SysUtils.FindFirst  (0) 2017.03.16
[Reference] System.Val  (0) 2017.03.15
[Reference] System.SysUtils.TimeToStr  (0) 2017.03.13
[Reference] System.SysUtils.FileExists  (0) 2017.03.12
[Reference] System.Halt  (0) 2017.03.12
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함