Handle the joystick with events (DirectInput and C#)

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.
 
D

DeveloperX

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.
 
V

Vicente Nicolau

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top