Ticket #11621 (closed defect: fixed)
Problem with handling wxEVT_KEY_DOWN for navigation keys in wxTreeCtrl
| Reported by: | TNikolay | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | wxMSW | Version: | 2.9-svn |
| Keywords: | wxTreeCtrl selection | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
I use wxEVT_KEY_DOWN handler for wxTreeCtrl in order to realize add keyboard shortcuts for additional functional at my tree control. Problem is application don't receive wxEVT_KEY_DOWN event for some keys (used for navigation). I am sure that the problem is in the following code:
wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
....
// normally we want to generate wxEVT_KEY_DOWN events from TVN_KEYDOWN
// notification but for the keys which can be used to change selection
// we need to do it from here so as to not apply the default behaviour
// if the events are handled by the user code
switch ( wParam )
{
case VK_RETURN:
case VK_SPACE:
case VK_UP:
case VK_DOWN:
case VK_LEFT:
case VK_RIGHT:
case VK_HOME:
case VK_END:
case VK_PRIOR:
case VK_NEXT:
if ( !MSWHandleTreeKeyDownEvent(wParam, lParam) )
{
// use the key to update the selection if it was left
// unprocessed
MSWHandleSelectionKey(wParam);
}
// pretend that we did process it in any case as we already
// generated an event for it
processed = true;
//default: for all the other keys leave processed as false so that
// the tree control generates a TVN_KEYDOWN for us
}
It breaks compability with 2.8 branch and doesn't leave us a chance to realize own reaction at this keys.is this a bug?
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

