CXTPControlEditCtrl::OnKeyDown |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
Posted: 13 December 2021 at 2:45pm |
I want the CXTPControlEditCtrl to execute if the user presses the return key. I found CXTPControlEditCtrl::OnKeyDown does just that. But it isn't even called in my case. I have added a CXTPControlEdit on our ribbon and it implements OnHookKeyDown. In that code it traps VK_RETURN and VK_CHAR and returns FALSE. What do I do to get the CXTPControlEditCtrl contol to get the OnKeyDown message handler to execute? Key down is in it's message map. So is mouse move and that fires when I move the mouse over the edit control. I have my own CXTPControlEditCtrl subclass. I added an OnKeyDown handler. It is called but not for VK_RETURN. I think that hooker being used is stopping the control edit ctrl from getting the message it needs and deserves. Don't know if it is the hooker but I have to be careful where I set breakpoints in OnHookKeyDown - visual studio break point trips and then VS quits responding and I have to kill it via task manager.
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
This seems slightly wrong but I finally overrode OnHookKeyDown and called the CXTPControlEdit::OnHookKeyDown. If it returns FALSE (not FALSE_EXIT - A slight "misuse" of BOOL) I see if nChar was VK_RETURN and if so, I called GetEditCtrl and then GetControlEdit and called OnExecute directly. I still can't quite fathom what this hooker returning FALSE is for or why the code isn't executing without me jumping thru these hoops. Its like the buddy button is a must. Without it and this new code, I wouldn't have been able to get the user to hit return to perform my action. I added the buddy button first and did not avoid that code when I found return not working. I did search thru the CJ edit code to see if the buddy button had anything to do with return not working but I didn't see anything obvious so I left that code as is. Besides, I want both a buddy click or a return to execute my code.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |