SDL.NET Joystickproblems

Started by
-1 comments, last by Ekenstenen 15 years, 4 months ago
Okay, first of all, I was unsure where to post this question, but I will give it a try in "For Beginners". So I got a problem, as the subject says. I am at the moment writing a menusystem for my HTPC in C# SDL.NET and today I got my NES usbhandcontroll, which was my intention to have it as a control for the menu. At first I tried the control, and it worked fine, as in emulators and such, but when I started to make it work with the menu the problems started. The axismotionevent reacts accordingly. But the event for JoystickButtonDown doesn't even react when I try to push a button (duh). This is what I know:

Joystick joystick = Joystick.OpenJoystick(0);
This gives the right information as I know of, that is: "Number of axes: 2" "Number of buttons: 4" So what I know of is that SDL atleast detects the gamepad. My code in short:

using SdlDotNet.Core;
using SdlDotNet.Input;

class Program
{
 public static void Main()
 {
  Events.JoystickButtonDown += new EventHandler<JoystickButtonEventArgs>(this.JoystickButtonDown);
  Joystick joystick = Joysticks.OpenJoystick(0);
  Events.Run();
 }

 private void JoystickButtonDown(object sender, JoystickButtonEventArgs e)
 {
  Console.WriteLine("Give me a sign");
 }
}
I don't know if the code is the problem, and I can't see why it would be the problem. If anyone got any experience of this problem, or can solve the problem, please answer. If you need more information, which I have probably forgot to post, please say so. //Ekenstenen

This topic is closed to new replies.

Advertisement