Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unable to query registry key for joystick at index 0  (Read 2420 times)

0 Members and 1 Guest are viewing this topic.

Dyponius

  • Newbie
  • *
  • Posts: 1
    • View Profile
Unable to query registry key for joystick at index 0
« 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 :)

jamesL

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: Unable to query registry key for joystick at index 0
« Reply #1 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


Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Unable to query registry key for joystick at index 0
« Reply #2 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Unable to query registry key for joystick at index 0
« Reply #3 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.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Unable to query registry key for joystick at index 0
« Reply #4 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.