Handle the joystick with events (DirectInput and C#)

  • Thread starter Thread starter Vicente Nicolau
  • Start date Start date
V

Vicente Nicolau

Hello,

I'm implementig a C# app in which I need to access to a Joystick. Nowadays
I'm using the DirectInput class for getting the actual joystick position,
but trhough polling.

I would like to do it through event, i.e., when you move the joystick, it
send to the app an event or message which you can hand with a handler.

The old joystick API has been superseded by DirectInput, and I have read
that with the joystick API you can read the messages from the joystick (but
not with C#).

But with DirectInput I have found nothing about theses messajes, only with
pulling...

Can anyone help me?

Thank you very much.
 
Hello,

I'm implementig a C# app in which I need to access to a Joystick. Nowadays
I'm using the DirectInput class for getting the actual joystick position,
but trhough polling.

I would like to do it through event, i.e., when you move the joystick, it
send to the app an event or message which you can hand with a handler.

The old joystick API has been superseded by DirectInput, and I have read
that with the joystick API you can read the messages from the joystick (but
not with C#).

But with DirectInput I have found nothing about theses messajes, only with
pulling...

Can anyone help me?

Thank you very much.

I don't think you can via the framework, although XNA may, I assume
you're using managed framework 1.1 for some reason.
One solution would be create a class that manages the polling and have
that raise events as required.
 
DeveloperX said:
I don't think you can via the framework, although XNA may, I assume
you're using managed framework 1.1 for some reason.
One solution would be create a class that manages the polling and have
that raise events as required.


I'm only using the managed framework 1.1 for access to the joystick.

Could you tell me some ideas about how to do it with XNA?
 
Back
Top