
How can I call a Joystick Event?
Posted Tuesday, 9 October, 2012 - 17:32 by Adn1210 inHello
I am not an advance user of c# but i'm trying to do an aplication to use OpenGL and Joystick Functions.
I want to use the GL_Control because i'm going to use formulars and so on.
I want to know if i can call or create a Joystick event, i've seen that i can try to read the Joystick in "OnUpdateFrame", but can i manage that with an event?
Best Regards
p.S. I'm working on Visual Studio 10, Win7 64bits & a Xbox 360 controller
My code so far
public partial class Form1 : Form { public Form1() { InitializeComponent(); } GameWindow hid = new GameWindow(); JoystickDevice joy; private void Form1_Load(object sender, EventArgs e) { joy = hid.Joysticks[0]; MessageBox.Show(joy.Description); textBox1.Text = joy.Description; joy.ButtonDown += new EventHandler<JoystickButtonEventArgs>(Joydown); } void Joydown(object sender, JoystickButtonEventArgs e) { MessageBox.Show("I'm in"); } }


Comments
Re: How can I call a Joystick Event?
For this type of game investigate here. Afaik there's no tested XInput driver in trunk, you may have to look in branches or use an emu like x360ce.