Problem beginning with SDL

Hi all,
I get the error: Unable to open keyboard when running the following
code.
I want to use SDL on fbcon and have no need for the mouse so can I quash
this
error?

int main () {
printf (“Initializing SDL.\n”);

// Initialize defaults, Video and Audio
if ((SDL_Init (SDL_INIT_VIDEO) == -1)) {
    printf ("Could not initialize SDL: %s.\n", SDL_GetError ());
    exit (-1);
}

printf ("SDL initialized.\n");
printf ("Quiting SDL.\n");

// Shutdown all subsystems
SDL_Quit ();

printf ("Quitting....\n");
exit (0);

}

Hi all,
I get the error: Unable to open keyboard when running the following
code.
I want to use SDL on fbcon and have no need for the mouse so can I quash
this
error?

Yes, but it’s not portable and not officially supported.
Set the SDL_NOMOUSE environment variable:

#if defined(linux) || defined(FreeBSD)
putenv(“SDL_NOMOUSE=1”);
#endif

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This doesn’t work. Which versions is it valid for?

“Sam Lantinga” wrote in message
news:E14dxWL-0000Se-00 at roboto.devolution.com…> > Hi all,

I get the error: Unable to open keyboard when running the following

code.
I want to use SDL on fbcon and have no need for the mouse so can I quash
this
error?

Yes, but it’s not portable and not officially supported.
Set the SDL_NOMOUSE environment variable:

#if defined(linux) || defined(FreeBSD)
putenv(“SDL_NOMOUSE=1”);
#endif

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I’m guessing this would need to go in main(), before you call SDL_INIT().
Might want to check where you put it.On Friday 16 March 2001 11:01, you wrote:

This doesn’t work. Which versions is it valid for?

“Sam Lantinga” wrote in message
news:E14dxWL-0000Se-00 at roboto.devolution.com

Hi all,
I get the error: Unable to open keyboard when running the following
code.
I want to use SDL on fbcon and have no need for the mouse so can I
quash this
error?

Yes, but it’s not portable and not officially supported.
Set the SDL_NOMOUSE environment variable:

#if defined(linux) || defined(FreeBSD)
putenv(“SDL_NOMOUSE=1”);
#endif

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software