|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2019/10/14 9:06:50 |
标题: |
Delphi xe10.3中 我想在timer中实现判断同时按下了鼠标右键和键盘中的f1(键码112)键,代码应该怎么写,谢谢! |
浏览:937 |
|
加入我的收藏 |
楼主: |
Delphi xe10.3中 我想在timer中实现判断同时按下了鼠标右键和键盘中的f1(键码112)键,代码应该怎么写,谢谢!
----------------------------------------------
- |
作者: |
|
2019/10/14 10:41:17 |
1楼: |
procedure TForm1.Timer1Timer(Sender: TObject); begin Timer1.Enabled := False; if (GetKeyState(VK_RBUTTON) < 0) and (GetKeyState(VK_F1) < 0) then begin Caption := 'Right Mouse Click + F1'; end else begin Caption := 'Nothing'; end; Timer1.Enabled := True; end;
----------------------------------------------
-广袤璀璨的银河,永无止境的梦想(梦无止境游银河) 博客挂了……
|
作者: |
|
2019/10/14 13:28:42 |
2楼: |
iamdream 谢谢,我试一试
----------------------------------------------
-
|
作者: |
|
2019/10/14 13:30:55 |
3楼: |
[dcc64 Error] Unit2.pas(86): E2003 Undeclared identifier: 'GetKeyState' [dcc64 Error] Unit2.pas(86): E2003 Undeclared identifier: 'VK_RBUTTON' [dcc64 Warning] Unit2.pas(86): W1023 Comparing signed and unsigned types - widened both operands [dcc64 Error] Unit2.pas(86): E2003 Undeclared identifier: 'VK_F1' [dcc64 Warning] Unit2.pas(86): W1023 Comparing signed and unsigned types - widened both operands [dcc64 Fatal Error] Unit1.pas(31): F2063 Could not compile used unit 'Unit2.pas' Failed Elapsed time: 00:00:01.1
----------------------------------------------
-
|
作者: |
|
2019/10/14 13:31:23 |
4楼: |
出现这个提示,编译通不过
----------------------------------------------
-
|
作者: |
|
2019/10/14 13:49:14 |
5楼: |
uses Windows, Messages, sysutils; 加入,谢谢,好了
----------------------------------------------
-
|
|