Click here to Skip to main content
16,006,006 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi, i hope someone can help, this is driving me crazy

my left arrow key has just stopped generating ON_WM_KEYDOWN events

i know the key is actually working and i can see the key here

SQL
BOOL CTabTraxView::PreTranslateMessage(MSG* pMsg)
{
    switch (pMsg->message)
    {
    case WM_KEYDOWN:
        TRACE("CTabTraxView::PreTranslateMessage(MSG* pMsg) %d\n", pMsg->lParam);
    case WM_SYSKEYDOWN:
    case WM_LBUTTONDOWN:
    case WM_RBUTTONDOWN:
    case WM_MBUTTONDOWN:
    case WM_LBUTTONUP:
    case WM_RBUTTONUP:
    case WM_MBUTTONUP:
    case WM_MOUSEMOVE:
        m_ToolTip.RelayEvent(pMsg);
        break;
    }
    return CScrollView::PreTranslateMessage(pMsg);
}


but here

C#
void CTabTraxView::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags)
{
    TRACE("CTab2midiView::OnKeyDown nChar=%d\n", nChar);
    GetDocument()->OnKeyDown(nChar);
}



i can see all keys including VK_RIGHT but not VK_LEFT

please help if you can, i don't really want to call OnKeyDown from PreTranslateMessage, i'd rather find and fix the problem
Posted
Comments
Resmi Anna 6-Jun-11 8:19am    
are you saying that in debug trace you could not see the line

"CTab2midiView::OnKeyDown nChar=37" while pressing Left arrow key???

1 solution

hi, i just found it, i forgot a added an accelerator for VK_LEFT

so i figured i would just remove it and all's well! well no, it still didn't work.

but then i remembered that in vs2010, MFC apps seem to save state so changing stuff in code doesn't always change stuff which can be VERY confusing

so in my main entry point, i change SetRegistryKey(_T(2112Design")); to SetRegistryKey(_T("x2112Design")); so it forgets its settings

BUT i would like to revert to the original SetRegistryKey(_T(2112Design")); but that kills the VK_LEFT key

is there any way to flush the system registry?

thx steve

OK, just answered my own question again, use regedit on HKEY_CURRENT_USER\Software\<company name>\<application name>\

and delete everything
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900