Hi, http://trac.wxwidgets.org/attachment/ticket/13679/patch.patch is a Wx patch that addresses an accelerator key handling issue I ran into. I've adapted it for Wx::ActiveX. It also seems the code no longer compiles, two event handling functions that it calls are `protected` now. This is discussed in wx/include/wx/window.h "To ensure correct operation..." and I followed the advice there. My HTML content now receives keydown events triggered by keys like arrow down, so this seems to work, but I've not tested it much beyond that yet.
regards, -- Björn Höhrmann · mailto:bjo...@hoehrmann.de · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
diff -u \temp\Wx-ActiveX-0.15\cpp/wxactivex.cpp ./wxactivex.cpp --- \temp\Wx-ActiveX-0.15\cpp/wxactivex.cpp 2010-03-16 10:46:15.000000000 +0100 +++ ./wxactivex.cpp 2011-11-25 16:34:49.063000000 +0100 @@ -487,6 +487,25 @@ CreateActiveX(clsid); }; +//--------------------------------------------------------------------------- +// wxActiveXContainer::MSWProcessMessage +// +// Called for every message to be processed. +// Some controls might need more keyboard keys to process (CTRL-C, CTRL-A ect), +// In that case TranslateAccelerator should always be called first. +//--------------------------------------------------------------------------- +bool wxActiveX::MSWProcessMessage(WXMSG* pMsg) +{ + if(pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) + { + if(m_oleInPlaceActiveObject.Ok() && m_oleInPlaceActiveObject->TranslateAccelerator(pMsg) == S_OK) + { + return true; + } + } + return wxWindow::MSWProcessMessage(pMsg); +} + //////////////////////////////////////////////////////////////////////////////////////////////////////////// // Case Insensitive Map of Event names to eventTypes // created dynamically at run time in: @@ -966,7 +985,7 @@ if (func.hasOut) { IV nArg = min((IV)func.params.size(), (IV)pDispParams->cArgs); - m_activeX->GetParent()->ProcessEvent(event); + m_activeX->GetParent()->GetEventHandler()->ProcessEvent(event); for (IV i = 0; i < nArg; i++) { VARIANTARG& va = pDispParams->rgvarg[i]; @@ -981,7 +1000,7 @@ }; } else - m_activeX->GetParent()->AddPendingEvent(event); + m_activeX->GetParent()->GetEventHandler()->AddPendingEvent(event); }; diff -u \temp\Wx-ActiveX-0.15\cpp/wxactivex.h ./wxactivex.h --- \temp\Wx-ActiveX-0.15\cpp/wxactivex.h 2010-03-12 16:46:30.000000000 +0100 +++ ./wxactivex.h 2011-11-25 14:19:20.216000000 +0100 @@ -587,6 +587,7 @@ void CreateActiveX(REFCLSID clsid); void CreateActiveX(LPOLESTR progId); + virtual bool MSWProcessMessage(WXMSG* pMsg); HRESULT AmbientPropertyChanged(DISPID dispid); void GetTypeInfo();