Author Topic: Razer Onza Tournament controller not detected as xbox controller  (Read 5432 times)

villadelfia

  • Posts: 2
  • Maggot Crusher.
    • View Profile
As said in the title, a Razer Onza Tournament controller is not detected as an xbox controller, and thus does not allow the use of the triggers and does not respect the player number lights on the controller.

The razer controller identifies itself under the name "XBOX360 GAMEPAD" and has a vendor id of 1689 and a product id of FD00.

It is compatible as an XInput controller in every other game. If you need any more information to support it as an XInput controller, please let me know.

EDIT: I took the liberty to fix the bug myself. In ARPGGame.XboxControllerDetection you need to change the IsXbox360Controller method:
Code: [Select]
// ... stuff ...
if(caps.Mid == 1118) { // Microsoft Controllers
    if(caps.ProductId == 654 || caps.ProductId == 655 || caps.ProductId == 657 || caps.ProductId == 658 || caps.ProductId ==
        1817 || caps.ProductId == 673) {
        return true;
    }
} else if(caps.Mid == 3695 && caps.ProductId == 531) { // Afterglow Controller?
    return true;
} else if(caps.Mid == 5769) { // Razer Onza TE and SE
    if(caps.ProductId == 64768 || caps.ProductId == 64769) {
        return true;
    }
}
// ... stuff ...

Note that this is from ILSpy, I have no clue how the code looks in the actual codebase.

Also note that this does not fix the game not paying attention to the ordering of the controllers according to the LED's. However, I can now at least use LTrigger and RTrigger.
« Last Edit: August 20, 2013, 05:34:33 AM by villadelfia »

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: Razer Onza Tournament controller not detected as xbox controller
« Reply #1 on: August 24, 2013, 02:35:20 PM »
I don't know how the player number lights is implemented by Razor, but we just use the order that Windows gives us. Thanks for that fix, I'll add it to the next patch.

villadelfia

  • Posts: 2
  • Maggot Crusher.
    • View Profile
Re: Razer Onza Tournament controller not detected as xbox controller
« Reply #2 on: August 25, 2013, 01:08:09 PM »
OpenTK doesn't have direct support of XInput, so you have no way of getting the player number since you don't have access to the right API.

Even with XInput, you would only be able to ask "Does controller 1 exist? If so please give me its state." and not the other way around, that would make it hard to combine with non-xinput controllers, though not impossible.

If you want to put the time and effort into it, you can take a look at XInputDotNet, it is mono compatible and should obsolete the Mid/Vid hack you are using to detect xbox 360 controllers.