The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
vJoy joystick only visible when haptic is initialized.
die_hoernse


Joined: 06 Jan 2015
Posts: 3
Hello,

I am switching between a PS/2 to USB Joystick converter (at home) and a vJoy joystick emulation (at work) to test joystick input for an SDL based application.

Using the PS/2 to USB converter this code works fine
Code:
SDL_Init(SDL_INIT_JOYSTICK);
if (SDL_NumJoysticks() > 0) {
    joystick = SDL_JoystickOpen(0);
}

but using vJoy the returned joystick count is zero. I can use vJoy if i add haptic support:
Code:
SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC);
if (SDL_NumJoysticks() > 0) {
    joystick = SDL_JoystickOpen(0);
}


Should that be and/or why is it that way?

vJoys configuration:
[/img]