tags:

views:

376

answers:

2

I was wondering if there was a way to write a program that could bind buttons on a gamepad to certain mouse/keyboard inputs. For example moving an analog stick on the gamepad to move the mouse, and clicking certain buttons on the gamepad == pressing keyboard keys or mouse clicks. Which language would be able to do this?

Thanks!

+2  A: 

Of course you can do this. The issue is getting the responsiveness to be almost immediate. You can do this with any language that provides a way to talk to input devices.

  1. Listen for input from gamepad.

  2. If input received, map to corresponding button.

  3. Suppress the gamepad input.

Jon
+2  A: 

Sure, its possible. You just need some sort of Joystick interface that allows you to read its actions and then your program can translate it into other actions sent to the system.

For example, in Java, you can use Jinput to read the joystick and then use jawa.awt.Robot to move the mouse. You may want to use some movement controls, such as a quadratic gradient to speedup/slowdown the mouse movements the longer the joystick is pushed in one direction, for instance.

yx
Actually instead of the longer the joystick is pushed down I would like it to be how far the joystick it pressed. But yeah thanks for the links.
John Isaacks