Hi all,
I am starting to play around with the B3D SDK under C# .NET.
I am having a few problems with handling events.
For keyboard input, I have cheated a little by overriding the main OnKeyDown handler
i.e.
I cannot do the same with the mouse events though:
e.g. If I use this code:
The Mouse Click Event message is only shown when I click on an area which is outside of the panel control (which houses the SDK rendering window).
None of the panel control's events (e.g. MouseEnter, MouseLeave) work either.
This seems to suggest the B3D render window "swallows" the mouse events before .NET.
Any ideas how to get around this? I have read about the SetBlitz3DEventCallback method, but I have no idea how to use it from within C# .NET.
Cheers.
Daz.
I am starting to play around with the B3D SDK under C# .NET.
I am having a few problems with handling events.
For keyboard input, I have cheated a little by overriding the main OnKeyDown handler
i.e.
protected override void OnKeyDown(KeyEventArgs e)
{
my_keydown(e);
base.OnKeyDown(e);
}
void my_keydown(KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.Escape))
{
MessageBox.Show("You pressed escape");
}
if (e.Alt && e.KeyCode == Keys.A)
{
MessageBox.Show("Alt + A");
}
}
I cannot do the same with the mouse events though:
e.g. If I use this code:
protected override void OnMouseClick(MouseEventArgs e)
{
my_mouseclick(e);
base.OnMouseClick(e);
}
void my_mouseclick(MouseEventArgs e)
{
MessageBox.Show("Mouse Click Event");
}
The Mouse Click Event message is only shown when I click on an area which is outside of the panel control (which houses the SDK rendering window).
None of the panel control's events (e.g. MouseEnter, MouseLeave) work either.
This seems to suggest the B3D render window "swallows" the mouse events before .NET.
Any ideas how to get around this? I have read about the SetBlitz3DEventCallback method, but I have no idea how to use it from within C# .NET.
Cheers.
Daz.