FW: Missing Mouse causes SDL not to initialise

Hi

Sorry to reply to my own mail.

I have solved the problem by modifying the SDL source code as follows:-

In SDL_dx5events.c

struct {
char *name;
REFGUID guid;
LPCDIDATAFORMAT format;
DWORD win_level;
DWORD raw_level;
void (*fun)(const int numevents, DIDEVICEOBJECTDATA events);
} inputs[] = {
{ “keyboard”,
&GUID_SysKeyboard, &c_dfDIKeyboard,
(DISCL_FOREGROUND|DISCL_NONEXCLUSIVE),
(DISCL_FOREGROUND|DISCL_NONEXCLUSIVE), handle_keyboard },
/
{ “mouse”,
&GUID_SysMouse, &c_dfDIMouse,
(DISCL_FOREGROUND|DISCL_NONEXCLUSIVE),
(DISCL_FOREGROUND|DISCL_EXCLUSIVE), handle_mouse },
{ NULL, NULL, NULL, 0, 0, NULL } */
};

Commenting out the mouse section above enabled SDL to start correctly on a
mouseless system. The interesting this was that the mouse still worked fine
on a system with a mouse.

I would prefer to use a standard SDL library rather than the modified one -
is there another way round this problem?

If not, then can anyone see any unwelcome consequences to my modification
above?

Many thanks

Steve Lupton> ----- Original Message -----

From: Steve Lupton [mailto:SL@cre.co.uk]
Sent: 05 November 2001 09:36
To: 'sdl at libsdl.org
Subject: [SDL] Missing Mouse causes SDL not to initialise

Hi

Can anyone help with what is possibly a simple problem.

On a Windows 2000 target, if there is no mouse plugged into the machine, SDL
will not initialise (it fails with a directinput error).

Is it possible for SDL to not require a mouse.

Thanks.

Steve Lupton


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com



SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Commenting out the mouse section above enabled SDL to start correctly on a
mouseless system. The interesting this was that the mouse still worked fine
on a system with a mouse.

I would prefer to use a standard SDL library rather than the modified one -
is there another way round this problem?

What has been done for other drivers is to add an environment variable
SDL_NOMOUSE, which if set, doesn’t fail the initialization if the mouse
device can’t be opened. In the general case, you do want to fail if the
application won’t be getting any mouse input.

If not, then can anyone see any unwelcome consequences to my modification
above?

The mouse won’t work in fullscreen mode.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment