SFML community forums

Help => General => Topic started by: Dyponius on February 27, 2017, 10:37:30 pm

Title: Unable to query registry key for joystick at index 0
Post by: Dyponius on February 27, 2017, 10:37:30 pm
Hello, I've been trying to set up SFML for a while now, and I think I've almost got it working correctly. I have the simple code to open a window, but it doesn't seem to work. A blank window opens for about a half-second, then instantly closes. The console prints
Quote
"Unable to query registry key for joystick at index 0: The system cannot find the file specified.
Press any key to continue...
I'm pretty positive that it isn't an error in the code, but here it is anyway:
#include <SFML/Window.hpp>
using namespace sf;

int main() {
        Window window(VideoMode(1200, 800), "Window!");

        return 0;
}

Sorry to bother you, but I could use some help. Thank you :)
Title: Re: Unable to query registry key for joystick at index 0
Post by: jamesL on February 28, 2017, 08:53:28 am
go here

http://www.sfml-dev.org/tutorials/2.4/window-window.php


scroll down to the section named
Bringing the window to life

use that sample code instead and see  what happens

Title: Re: Unable to query registry key for joystick at index 0
Post by: Hapax on March 01, 2017, 09:25:19 pm
The instant closing of the window is to be expected as its not being held open, which is solved by what was said by JamesL.

However, your joystick error should not be relevant to that.

Some more information will most likely be necessary.
e.g. operating system; IDE/compiler; debug/release; number and types of joysticks connected, if any.
Title: Re: Unable to query registry key for joystick at index 0
Post by: Mario on March 06, 2017, 11:28:04 pm
Think I can actually reproduce this. Will have to check tomorrow, but I've seen this error whenever I've had my HOTAS joystick plugged in. I guess the driver somehow causes a few registry keys to not be populated the way SFML expects them to be.
Title: Re: Unable to query registry key for joystick at index 0
Post by: Mario on March 13, 2017, 07:06:42 pm
I used to get that joystick error for a while, but seems like the bug is gone now. I assume it's related to drivers not being properly installed. It shouldn't have any significant impact on SFML's use other than reporting that warning and SFML not being able to determine the proper joystick/gamepad name.