catching return key (VK_RETURN) with OnKeyDown
-
Hello, It seems that in the app. where I'm working on, the default behaviour of
OnKeyDown
doesn't seem to catch the return key. Can you modify this? Can you modify this for 1 class and not for the entire app.? tnx! "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix -
Hello, It seems that in the app. where I'm working on, the default behaviour of
OnKeyDown
doesn't seem to catch the return key. Can you modify this? Can you modify this for 1 class and not for the entire app.? tnx! "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix -
Hi , you need to overide the virtualfunction OnGetDlgCode, and then write the following line of code . Your Class must be derived from CWnd. return CYourClass::OnGetDlgCode() | DLGC_WANTALLKEYS; Djizzio
Hey, tnx for your reply. I did this:
UINT CtrlFlexArray::OnGetDlgCode(){ return CWnd::OnGetDlgCode() | DLGC_WANTALLKEYS; } //end function OnGetDlgCode
but the OnKeyDown still doesn't catch the return key. Did I forgot something or did I do something wrong? (NOTE: CtrlFlexArray is derived from CvsFlexArray and CvsFlexArray from CWnd, but I don't think this is the problem) tnx! "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix -
Hello, It seems that in the app. where I'm working on, the default behaviour of
OnKeyDown
doesn't seem to catch the return key. Can you modify this? Can you modify this for 1 class and not for the entire app.? tnx! "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix -
Is it a dialog based application ? If so there is information in the FAQ forum[^]. Elaine :rose: The tigress is here :-D
-
Hey, tnx for your reply. I did this:
UINT CtrlFlexArray::OnGetDlgCode(){ return CWnd::OnGetDlgCode() | DLGC_WANTALLKEYS; } //end function OnGetDlgCode
but the OnKeyDown still doesn't catch the return key. Did I forgot something or did I do something wrong? (NOTE: CtrlFlexArray is derived from CvsFlexArray and CvsFlexArray from CWnd, but I don't think this is the problem) tnx! "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi HendrixDon't forget to add ON_WM_GETDLGCODE() to the message map of your class.