- void CEXForKeyDlg::OnButtonStart()
- {
- // TODO: Add your control notification handler code here
- CString str="start this game for debugging.\r\n";
- ShowInfo(str);
- }
- void CEXForKeyDlg::OnButtonEnd()
- {
- // TODO: Add your control notification handler code here
- CString str="end this game for debugging.\r\n";
- ShowInfo(str);
- }
- void CEXForKeyDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- // TODO: Add your message handler code here and/or call default
- switch(nChar)
- {
- case 'S':
- if(!m_bCheckKey[0])
- {
- OnButtonStart();
- m_bCheckKey[0]=TRUE;
- }
- break;
- CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
- }
- void CEXForKeyDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
- {
- // TODO: Add your message handler code here and/or call default
- switch(nChar)
- {
- case 'S':OnButtonEnd();m_bCheckKey[0]=FALSE;break;
- }
- CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
- }
- BOOL CEXForKeyDlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- if(pMsg->message==WM_KEYDOWN)
- {
- SendMessage(pMsg->message, pMsg->wParam, pMsg->lParam);
- return true;
- }
- else if(pMsg->message==WM_KEYUP)
- {
- SendMessage(pMsg->message, pMsg->wParam, pMsg->lParam);
- return true;
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
- void CEXForKeyDlg::ShowInfo(const CString& str)
- {
- m_strEditShow+=str;
- GetDlgItem(IDC_EDITSHOW)->SetWindowText(m_strEditShow);
- CEdit * output=(CEdit *)GetDlgItem(IDC_EDITSHOW);
- output->LineScroll(output->GetLineCount());
- }
ESC键 VK_ESCAPE (27)
回车键: VK_RETURN (13)
TAB键: VK_TAB (9)
Caps Lock键: VK_CAPITAL (20)
Shift键: VK_SHIFT ()
Ctrl键: VK_CONTROL (17)
Alt键: VK_MENU (18)
空格键: VK_SPACE (/32)
退格键: VK_BACK (8)
左徽标键: VK_LWIN (91)
右徽标键: VK_LWIN (92)
鼠标右键快捷键:VK_APPS (93)
Insert键: VK_INSERT (45)
Home键: VK_HOME (36)
Page Up: VK_PRIOR (33)
PageDown: VK_NEXT (34)
End键: VK_END (35)
Delete键: VK_DELETE (46)
方向键(←): VK_LEFT (37)
方向键(↑): VK_UP (38)
方向键(→): VK_RIGHT (39)
方向键(↓): VK_DOWN (40)
F1键: VK_F1 (112)
F2键: VK_F2 (113)
F3键: VK_F3 (114)
F4键: VK_F4 (115)
F5键: VK_F5 (116)
F6键: VK_F6 (117)
F7键: VK_F7 (118)
F8键: VK_F8 (119)
F9键: VK_F9 (120)
F10键: VK_F10 (121)
F11键: VK_F11 (122)
F12键: VK_F12 (123)
Num Lock键: VK_NUMLOCK (144)
小键盘0: VK_NUMPAD0 (96)
小键盘1: VK_NUMPAD1 (97)
小键盘2: VK_NUMPAD2 (98)
小键盘3: VK_NUMPAD3 (99)
小键盘4: VK_NUMPAD4 (100)
小键盘5: VK_NUMPAD5 (101)
小键盘6: VK_NUMPAD6 (102)
小键盘7: VK_NUMPAD7 (103)
小键盘8: VK_NUMPAD8 (104)
小键盘9: VK_NUMPAD9 (105)
小键盘.: VK_DECIMAL (110)
小键盘*: VK_MULTIPLY (106)
小键盘+: VK_MULTIPLY (107)
小键盘-: VK_SUBTRACT (109)
小键盘/: VK_DIVIDE (111)
Pause Break键: VK_PAUSE (19)
Scroll Lock键: VK_SCROLL (145)
阅读(670) | 评论(0) | 转发(0) |