?? 鍵盤事件.txt
字號:
1.建一個文件夾,用于放程序。
2.新建一個程序。
3.保存(用Save All)到該文件夾
4.添加一個幾何(Shape)控件
5.在左邊的"對象觀察器"(Object Inspector)工具欄翻到"事件"(Event)
添加"鍵盤事件"(OnKeyDown),并添加代碼
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
Form1.Caption:=IntToStr(Key);
end;
改為:Form1.Caption:='你按鍵的值為:'+IntToStr(Key);
改為:
if Key=32 then Form1.Caption:='你按了空格鍵';
if Key=37 then Form1.Caption:='你按了左方向鍵';
if Key=65 then Form1.Caption:='你按了A鍵';
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -