Xbox 360 Controller being seen as normal joystick, not xinput
by Edward A. Kimsa-Rowntree · in Torque Game Engine Advanced · 12/17/2007 (7:01 am) · 6 replies
Has anyone else experienced this? Is there a fix, or is there something wrong with my drivers? I'm using Vista 64 bit, wondering if thats possibly the issue.
I enabled LOG_INPUT, thought that may give someone some insight perhaps.
So, according to the LOG, when its initially seen its seen as an Xbox controller, however when I'm actually trying to control things in the menu using it, its seen as a normal joystick (ID 3).
I enabled LOG_INPUT, thought that may give someone some insight perhaps.
Input log opened at Mon Dec 17 09:39:32 2007 Operating System: WinNT version 6.0 Build number 6000 Enabling XInput... XInput detected. Enabling DirectInput... DirectX 8 or greater detected. Enumerating input devices... K detected, created as keyboard0 (asynchronous). 109 total objects detected. 109 keys. M detected, created as mouse0 (asynchronous). 11 total objects detected. 8 buttons. 1 x-axis. 1 y-axis. 1 z-axis. X detected, created as joystick0 (asynchronous). 16 total objects detected. 10 buttons. 1 POVs. 1 x-axis. 1 y-axis. 1 z-axis. 1 r-axis. 1 u-axis. --- Filling the ASCII table! --- // Was Keyboard code here, irrelevant --- Finished filling the ASCII table! --- Activating DirectInput... keyboard0 acquired. Keyboard activated. joystick0 acquired. Joystick activated. Resynching key states for keyboard0! Resync done. EVENT (Win): mouse button0 pressed. MODS:... EVENT (Win): mouse button0 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): F12 key pressed. MODS:... keyboard0 unacquired. Keyboard deactivated. GetDeviceData called when keyboard0 is not acquired! EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. EVENT (DInput): joystick0 button7 pressed. MODS:... EVENT (DInput): joystick0 button7 released. joystick0 unacquired. *** CLOSING LOG ***
So, according to the LOG, when its initially seen its seen as an Xbox controller, however when I'm actually trying to control things in the menu using it, its seen as a normal joystick (ID 3).
#2
If thats the case though, back to reading more then heh
EDIT:
Found my problem, something stupid as usual ;)
Had enableJoystick(); in my script, should have been enableXInput();
12/17/2007 (11:35 am)
XInput isn't implemented already? I was under the impression it was, theres references to it throughout the code.If thats the case though, back to reading more then heh
EDIT:
Found my problem, something stupid as usual ;)
Had enableJoystick(); in my script, should have been enableXInput();
#3
Any ideas anyone?
12/18/2007 (10:25 am)
Well, ran into another problem. All my previous in-game binds don't work with xinput obviously, and the sample code that comes with the xinput samples doesn't seem to work either. So now my controller works in the menu, and not in-game unless I disable xinput and enable joystick when PlayGui wakes lol.Any ideas anyone?
#4
If yes, you might check if the "input" is correctly remapped in the Xinput code so it actually is handled correctly and not locked by the disabled keymap
12/18/2007 (10:33 am)
Did you make sure that you added its input to the mapping as well for the game keymap?If yes, you might check if the "input" is correctly remapped in the Xinput code so it actually is handled correctly and not locked by the disabled keymap
#5
edit: Seems only the thumbsticks and triggers don't work.
12/18/2007 (12:08 pm)
#ifdef TORQUE_OS_WIN32
//-------------------------------------- XINPUT EVENTS -- jason_cahill
// Controller connect / disconnect:
{ "connect", SI_BUTTON, XI_CONNECT },
// L & R Thumbsticks:
{ "thumblx", SI_MOVE, XI_THUMBLX },
{ "thumbly", SI_MOVE, XI_THUMBLY },
{ "thumbrx", SI_MOVE, XI_THUMBRX },
{ "thumbry", SI_MOVE, XI_THUMBRY },
// L & R Triggers:
{ "triggerl", SI_MOVE, XI_LEFT_TRIGGER },
{ "triggerr", SI_MOVE, XI_RIGHT_TRIGGER },
// DPAD Buttons:
{ "dpadu", SI_BUTTON, XI_DPAD_UP },
{ "dpadd", SI_BUTTON, XI_DPAD_DOWN },
{ "dpadl", SI_BUTTON, XI_DPAD_LEFT },
{ "dpadr", SI_BUTTON, XI_DPAD_RIGHT },
// START & BACK Buttons:
{ "btn_start", SI_BUTTON, XI_START },
{ "btn_back", SI_BUTTON, XI_BACK },
// L & R Thumbstick Buttons:
{ "btn_lt", SI_BUTTON, XI_LEFT_THUMB },
{ "btn_rt", SI_BUTTON, XI_RIGHT_THUMB },
// L & R Shoulder Buttons:
{ "btn_l", SI_BUTTON, XI_LEFT_SHOULDER },
{ "btn_r", SI_BUTTON, XI_RIGHT_SHOULDER },
// Primary buttons:
{ "btn_a", SI_BUTTON, XI_A },
{ "btn_b", SI_BUTTON, XI_B },
{ "btn_x", SI_BUTTON, XI_X },
{ "btn_y", SI_BUTTON, XI_Y },
#endifGuessing this is what you mean, if so then yep, its in there. I haven't had to add anything, XInput has been in the source, so I'm a little unsure as to why its choosing not to work in-game.edit: Seems only the thumbsticks and triggers don't work.
#6
12/20/2007 (10:59 am)
Well, I haven't made any headway with this. From what I can see it should be working...
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
x,y,z,u are the 2 analog sticks
the only problem are your triggers, as from what I remember, only one will be working.
The POV btw is the digital 8way control
If you want X360 controller as such with all its features, you need to implement XInput (when I remember correctly, there is an implementation for that for TGB Pro) I fear ...