No keyboard attached -> error

hello all,

this is my first posting to the sdl mailinglist…

i have following problem:

i developed an application - based on Ralph Giles’ sdl-mngplay - to view
mng-files through svgalib. there is one server providing files to 4
diskless clients. and there is no keyboard attached to the clients.

i use an freebsd 4.11 system with following main libraries:
sdl-1.2.9,2
svgalib-1.4.3_5
libmng-1.0.9

so, when i boot the clients with an keyboard attached, everything works
fine, even when i disconnect the keyboard after booting. i can start the
application without the keyboard after booting.

but when i boot the client whithout an keyboard attached, so that the
system bios recognizes that there is no keyboard - mngplay won’t start.

it must be a problem with sdl…

may someone can tell me where i have to hack the sdl sourcecode, so that
sdl initialization works without keyboard?

(or how to hack the memory/BIOS stack, so that it seems that an keyboard
is attached? or how to wire a keyboard-dummy ps2-connector? ,)

greetings,
hannes / adm / graz / austria–

johannes raggam | @johannes_raggam

adm | o. kipcak & partner ges.m.b.h.
atelier graz | mariahilferstr. 1/1
a-8020 | graz | austria | tel:(+)316-47-47-50 | office at adm.at

hello again,
again this question,

an sdl based application won’t start without a keyboard attached. there
must be an error in the sdl-library.

i have to check it soon, but i think that
SDL_Init(SDL_INIT_VIDEO)
initializes the keyboard. and if no keyboard is present, the library
will produce an error and prevent the application from starting.

maybe anyone knows the sdl functions in detail and can give me a hint.

and when i find the solution i will post it here.

cheers,
jr.

johannes raggam wrote:> but when i boot the client whithout an keyboard attached, so that the

system bios recognizes that there is no keyboard - mngplay won’t start.

it must be a problem with sdl…

may someone can tell me where i have to hack the sdl sourcecode, so that
sdl initialization works without keyboard?

johannes raggam | @johannes_raggam

adm | o. kipcak & partner ges.m.b.h.
atelier graz | mariahilferstr. 1/1
a-8020 | graz | austria | tel:(+)316-47-47-50 | office at adm.at

Video drivers and keyboard events – in fact, all events – are indeed closely
linked in SDL. For svgalib check out src/video/svga/SDL_svgaevents.c.
Maybye you can disable keyboard handling with #ifdefs, or better, checking an
environment variable with getenv?On September 19, 2005 08:03 am, johannes raggam wrote:

hello again,
again this question,

an sdl based application won’t start without a keyboard attached. there
must be an error in the sdl-library.

i have to check it soon, but i think that
SDL_Init(SDL_INIT_VIDEO)
initializes the keyboard. and if no keyboard is present, the library
will produce an error and prevent the application from starting.

maybe anyone knows the sdl functions in detail and can give me a hint.

and when i find the solution i will post it here.

cheers,
jr.

now i found the relevant bits:

in
SDL-1.2.9/src/video/svga/SDL_svgavideo.c
at around line 260 i commented out the keyboard initialization.
thank you for your tip, tyler!

sure, #ifdefs and so on would be nicer, but for the first run it’s ok so…

AND: i discovered the SDL-1.2.9/src/video/dummy files. what’s the use of
these files? is it possible to use a dummy keyboard with them?

here the relevant code:
// SDL-1.2.9/src/video/svga/SDL_svgavideo.c
// line 260

// ADM NO KEYBOARD WORKAROUND
keyboard = 1;
/*
keyboard = keyboard_init_return_fd();
if ( keyboard < 0 ) {
SDL_SetError(“Unable to initialize keyboard”);
return(-1);
}
if ( SVGA_initkeymaps(keyboard) < 0 ) {
return(-1);
}

*/
// END ADM NO KEYBOARD WORKAROUND

Tyler Montbriand wrote:>>an sdl based application won’t start without a keyboard attached. there

must be an error in the sdl-library.
Video drivers and keyboard events – in fact, all events – are indeed closely
linked in SDL. For svgalib check out src/video/svga/SDL_svgaevents.c.
Maybye you can disable keyboard handling with #ifdefs, or better, checking an
environment variable with getenv?

johannes raggam | @johannes_raggam

adm | o. kipcak & partner ges.m.b.h.
atelier graz | mariahilferstr. 1/1
a-8020 | graz | austria | tel:(+)316-47-47-50 | office at adm.at

Offscreen rendering, essentially.On September 22, 2005 11:45 am, johannes raggam wrote:

AND: i discovered the SDL-1.2.9/src/video/dummy files. what’s the use of
these files?