We have a WPF .NET Control with a Hydra Visual Plugin being used in a Delphi application. When the ENTER key is pressed the Plugin is not seeing the event and the last control in Delphi to have focus before the WPF control was given focus is a button who’s event fires. I added an OnPreviewKeyDown event handler to the Plugin. The event handler sees all of the key presses except the ENTER (return) key.
Is there something special that is required for the ENTER (return) key to be processed by the Plugin rather than the Delphi application? Have I missed the obvious?
The focus is in a TextBox in the .NET WPF Control.
Ejay, thank you for the response. This is happening with the last release of Hydra 3 and the latest Hydra 4. Delphi 2010 and Visual Studio 2008 are the development environments. I am asking the Delphi programmer how focus is being transferred and will get the information posted. I’m on the Plugin/Visual Studio side.
procedure TMainForm.StartButton1Click(Sender: TObject);
var
sReturn : string;
begin
if (HYModuleManager1.FindModule(TestPluginDLL) = NIL) then
begin
HYModuleManager1.LoadModule(TestPluginDLL);
HYModuleManager1.CreateVisualPlugin(TestPluginName, fVisualPlugin, Panel1);
(fVisualPlugin as TestPluginVisual).SetEventSink(Self);
end;
Unfortunately still no luck, maybe you have some additional code or component that causes this problem. I’m attaching a small project that can be used for testing, can you please check if it’s working correctly for you? And if it does, can you please modify it (or send us a testcase) so we can reproduce the problem?