By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,462 Members | 1,478 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,462 IT Pros & Developers. It's quick & easy.

Handle the joystick with events (DirectInput and C#)

P: n/a
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.


Jan 31 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 31 Jan, 12:03, "Vicente Nicolau" <vini...@eui.upv.eswrote:
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.

Jan 31 '07 #2

P: n/a

"DeveloperX" <nn*****@operamail.comescribió en el mensaje
news:11**********************@q2g2000cwa.googlegro ups.com...
On 31 Jan, 12:03, "Vicente Nicolau" <vini...@eui.upv.eswrote:
>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.

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?


Feb 1 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.