Game Development Community

Listing Input devices

by Nathan Bowhay - ESAL · in Torque 3D Professional · 11/01/2010 (8:47 pm) · 2 replies

Anyone know of a way to list the input devices (keyboard, mouse, joystick...)?

#1
12/18/2010 (1:30 am)

In script or in C++?

In script, the only thing that I'm aware of is some Windows-specific script functions that, while not allowing to enumerate devices, make it possible to query the presence of certain types of input devices (isJoysticDetected, isXInputConnected).

In C++, you can go through the InputManager--which is a SimGroup--and look for its children to see the InputDevices that have been initialized.

Unfortunately, while InputDevices are SimObjects, neither the InputManager nor the InputDevices are registered and are thus not available from script. Otherwise, it would be easy to enumerate devices from script too. It'd just need some registerObject() calls in the code.
#2
12/20/2010 (7:05 pm)
Thanks for the reply! This will help a bunch.