|
|
Hi all,
I am newbie in C++, i have a project to check the stuck key of keyboard using VC++ MFC Dialog. Only one key can be press at same time.
example:
I pressed and hold 'a' and then press 'b'. It should prompt out an error message regarding there was more than 1 key pressed.
Below is my coding, i only able to detect a key pressed. If the 'a' key haven't release, 'b' key pressed, it will go in the sub-program and display 'b' key pressed.
What pragrameter i should using in MFC library to check there is more than 1 key pressed?
Thanks.
- BOOL Test_0Dlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- MSG* msg=(MSG*)pMsg;
- if(pMsg->message==WM_KEYDOWN)
- {
- // sub-program
- }
- return 0;
- }
复制代码 |
|