Game Development Community

Navigating GUIs using a gamepad/joystick

by Manoel Neto · in Torque Game Engine · 10/03/2006 (3:57 pm) · 2 replies

Hi,

I'm working on a small racing game for a display, and the only input device avaliable will be a racing wheel. I've managed to find out how to do some basic GUI navigation with the keyboard, but I can't get the Canvas to reposnd to joystick inputs no matter what. The joystick inputs are getting filtered down somewhere deep in the engine when I'm not in the game, but I can't find out where.

#1
10/03/2006 (6:41 pm)
Manoel, are you wanting this to work in all points of the GUI system? Or are you just wanting to be able to set up stuff at the remapping controls? I ask because I have an almost perfected method for the second one.
#2
10/04/2006 (12:25 pm)
When I was implementing the P5 resource, I noticed I couldn't get the new device to work unless it was assigned as the system mouse. When debugging, I realized input was not being processed in the GUI Canvas.

There are two things you need to do (which worked for me):

FIRST:
While on any of the GUI screens you wish to test input on. Call echoInputState() from the Console
and check the output to make sure your devices are connected and enabled.


NEXT:
1. Open engine\gui\core\guiCanvas.cpp
2. Find the function bool GuiCanvas::processInputEvent(const InputEvent *event)
3. Look through the function and you'll notice it is only processing input for mouse, keyboard, and XInput.

Process your joystick and gamepad stuff here.