USB Gamepad Not Found By SDL2 In Win 8.1 VM?

USB Gamepad Not Found By SDL2 In Win 8.1 VM?

Hi,

I am having problems with my USB gamepad not being found by SDL2
in a Microsoft Windows 8.1 Pro 64Bit guest VMWare Player virtual machine
under a Kubuntu 14.04 L.T.S. 64Bit host.

The USB gamepad is plugged into a USB 2.0 on my desktop
and Win 8.1 Control Panel correctly shows the gamepad connected and working
but my SDL2 video game does not find the USB gamepad?

How would I fix the above problem?
Thanks!

[Image: http://16bitsoft.com/Images/Stuff/Win8.1VM_USB_Gamepad_SDL2_Issue-01.png ]------------------------
JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

theGiallo wrote:

Could you post the code with which you detect the pads? I bet you are using SDL_GameController and it does not have the mapping. If so try to SDL_JoystickOpen (https://wiki.libsdl.org/SDL_JoystickOpen)

Code:
//-------------------------------------------------------------------------------------------------
Input::Input(void)
{
DEBUG = false;

EXIT_Game = false;

DelayAllUserInput = 0;

KeyOnKeyboardPressedByUser = -1;

MouseButtonPressed[0] = false;
MouseButtonPressed[1] = false;

JoystickDeviceOne = NULL;
JoystickDeviceTwo = NULL;
JoystickDeviceThree = NULL;

if (SDL_NumJoysticks() == 0)
{
    printf("No USB joysticks are plugged in.\n");
}
else
{
    if (SDL_NumJoysticks()>0)
    {
        JoystickDeviceOne = SDL_JoystickOpen(0);
        NumberOfJoyButtons[0] = SDL_JoystickNumButtons(JoystickDeviceOne);
        NumberOfJoyAxises[0] = SDL_JoystickNumAxes(JoystickDeviceOne);
        printf("SDL2 Joystick 0 initialized.\n");
    }

    if (SDL_NumJoysticks()>1)
    {
        JoystickDeviceTwo = SDL_JoystickOpen(1);
        NumberOfJoyButtons[1] = SDL_JoystickNumButtons(JoystickDeviceTwo);
        NumberOfJoyAxises[1] = SDL_JoystickNumAxes(JoystickDeviceTwo);
        printf("SDL2 Joystick 1 initialized.\n");
    }

    if (SDL_NumJoysticks()>2)
    {
        JoystickDeviceThree = SDL_JoystickOpen(2);
        NumberOfJoyButtons[2] = SDL_JoystickNumButtons(JoystickDeviceThree);
        NumberOfJoyAxises[2] = SDL_JoystickNumAxes(JoystickDeviceThree);
        printf("SDL2 Joystick 2 initialized.\n");
    }
}

for (int joy = 0; joy < 3; joy++)
{
    JoyUP[joy] = Axis1;
    JoyDOWN[joy] = Axis1;
    JoyLEFT[joy] = Axis0;
    JoyRIGHT[joy] = Axis0;
    JoyButton1[joy] = Button0;
    JoyButton2[joy] = Button1;
}

JoystickSetupProcess = JoySetupNotStarted;

for (int index = 0; index < 5; index++)
{
    JoystickDirectionHorizonal[index] = CENTER;
    JoystickDirectionVertical[index] = CENTER;
    JoystickButtonOne[index] = OFF;
    JoystickButtonTwo[index] = OFF;
    JoystickButton1Pressed[index] = false;
    JoystickButton2Pressed[index] = false;
}

KeyboardSetupProcess = KeyboardSetupNotStarted;
UserDefinedKeyButtonOne = -1;
UserDefinedKeyButtonTwo = -1;
UserDefinedKeyUP = -1;
UserDefinedKeyRIGHT = -1;
UserDefinedKeyDOWN = -1;
UserDefinedKeyLEFT = -1;
UserDefinedKeyPause = -1;

DelayAllUserInput = -1;

}

//-------------------------------------------------------------------------------------------------------------------------
JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com