¡Oh no! ¿Dónde está el JavaScript? El navegador Web no tiene JavaScript activado o no es compatible con JavaScript. Active JavaScript en su explorador Web para ver correctamente este sitio Web o actualizar a un navegador Web que admita JavaScript.
Sabías que...
La primera MadriDC DreamParty se celebró en Madrid el 26 de junio de 2004.

Mouse in SDL

Última actualización en 13 años hace
Is there a function in SDL that will tell me if a mouse is plugged in? The only thing I could find was actual mouse code. Anyone know if there's such a function?
Thanks for the warm welcome!

I'm not using Chui's SDL though because of the issues it has with sound.

I wrote myself a function to check if a mouse is present using maple_first_mouse(), which is all I appeared to need.

int DC_MousePresent() {

   uint8 mouse = maple_first_mouse();

   if (mouse == 0)
      return 0;
      return 1;


Hi fackue , great to see you in our web !

All the information is posted at Chui's Web:

I think so what you are looking for is :

SDL_DC_MapKey(int joy, SDL_DC_button button, SDLKey key)

SDL_DC_EmulateKeyboard(SDL_bool value)

Enable/disable keyboard emulation. By default, emulation is enabled when dreamcast keyboard not present.
This function needs SDL_OpenJoystick call for working.

SDL_DC_EmulateMouse(SDL_bool value)

Enable/disable mouse emulation using analog pad and buttons X & Y (only for first joystick found). By default, emulation is enabled when dreamcast mouse not present.
This function needs SDL_OpenJoystick call for working.


In my code usually, for those who dont own a dc mouse i just use:

SDL_Joystick *joystick; <----

and after SDL initialization:

fprintf(stderr, "No puedo iniciar SDL: %s\n", SDL_GetError());

if ( screen == NULL ) {
fprintf(stderr, "No puedo cambiar 640x480 video: %s\n", SDL_GetError());

if (SDL_NumJoysticks() >= 1) {
joystick = SDL_JoystickOpen(0);


by this way I can use the pad like the mouse, you wouldn't need to check if the mouse is connected, will be emulated by sdl and the pad. Anyway you can see in te code :

joystick = SDL_JoystickOpen(0);

Checking this I think so you should know where the mouse is connected, in case of, but this routine what does is to emulate itself in case of non exist.
I haven't touched mouse SDL code that much but If I recall well there was one, anyway the KOS init tells what peripherals are connected through console
puede ver todos los hilos de discusión en este foro.
puede iniciar un nuevo hilo de discusión en este foro.
no puede responder en este hilo de discusión.
no puede empezar en una encuesta en este foro.
puede cargar archivos adjuntos en este foro.
no puede descargar archivos adjuntos en este foro.
SEGA Saturno - Saturn, SEGA y Videojuegos