I'm using as base the code in Mogre tutorial 5 (Ogre startup sequence).
To get the Windows.Form Input working I inherit OgreStartup from Form. Although I can create a keyboard event handler it doesn't work.
Do I need to do something else other than inheriting from Form to get Windows.Form input working? (I don't want to use MogreFramework)?
Is using Windows.Form keyboard input efficient for an application that is supposed to run fast?
I personally would use DirectX to grab the input, DirectX.DirectInput
I have some examples if you need it
I wouldn't mind taking a look =]
Thanks for suggestion, I have DirectInput working. I got confused by the Loader Lock issue but I have that figured out too.
Yeah the Loader Lock issue is a pain! Google it if you are having that problem.
I thought i'd quickly post some code here anyway:
First of all include the Direct X in to the program (note: i use DXI to shorten the lengthy API structure)
using DXI = Microsoft.DirectX.DirectInput;
I set up some class variables so that my different methods can use DX
when i initialise my code i set up the input devices
keyboardInputDevice = new DXI.Device(DXI.SystemGuid.Keyboard);
mouseInputDevice = new DXI.Device(DXI.SystemGuid.Mouse);
then when i want to capture the input values, populate the states
mouseState = mouseInputDevice.CurrentMouseState;
keyState = keyboardInputDevice.GetCurrentKeyboardState();
you can get the x and y values from the mouse state, but to detect key presses use something like this.
//do something when the A key is pressed
// do something when the Z key is pressed
Hope this is useful to anyone?
I found the Axiom stuff from one of the samples to be of particularly good use.