Jump to content
  • Advertisement
Sign in to follow this  
Ekenstenen

SDL.NET Joystickproblems

This topic is 3610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!