Key Down event is not generated

Sanghamitra Biswas SBiswas at sirf.com
Sun Sep 9 23:49:58 PDT 2007


Hi All,

I have the following function:

void MainApplication::OnKeyDown(wxWindow* win, wxListEvent& event)
{
    switch (event.GetKeyCode())
    {
    case '1':
        {
        ProviderDialog* provDialog = new ProviderDialog(win);
        if (provDialog->ShowModal())
        {
            provDialog->OnExit();
            delete provDialog;
            win->Show();
            win->SetFocus();
        }
        }
        break;
    case '5':
        showLogsOnScreen();
        break;
    default:
        event.Skip();
        break;
    }
}

This function is being called from:
BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
    EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnKeyDown)
END_EVENT_TABLE()
void MyListCtrl::OnKeyDown(wxListEvent& event)
{
    switch(event.GetKeyCode())
    {
    case '1':
    case '5':
        wxGetApp().OnKeyDown(this, event);
        break;

    default:
        event.Skip();
        break;
    }
}

This is working 99% of the time, but once or twice the dialog did not
come up.

Is there any probability that the key Down event will not be generated? 

Thanks & Regards
Sanghamitra




More information about the wx-users mailing list