CONSTRUCTOR(static void init(void)) { register_video_client(&Video_SDL); register_keyboard_client(&Keyboard_SDL); register_mouse_client(&Mouse_SDL); register_config_scrub(sdl_scrub); }
/* DANG_BEGIN_FUNCTION keyb_client_init * * Figures out which keyboard client to use and initialises it. * * First it calls the probe method to see if it should use the client, * Then it call init to set that client up. * * If probe or init fails it trys another client. * * Eventually falling back to Keyboard_none a dummy client, which does nothing. * * DANG_END_FUNCTION */ int keyb_client_init(void) { int ok; if(Keyboard == NULL) register_keyboard_client(&Keyboard_raw); register_keyboard_client(&Keyboard_none); while(Keyboard) { k_printf("KBD: probing '%s' mode keyboard client\n", Keyboard->name); ok = Keyboard->probe && Keyboard->probe(); if (ok) { k_printf("KBD: initialising '%s' mode keyboard client\n", Keyboard->name); ok = Keyboard->init?Keyboard->init():TRUE; if (ok) { k_printf("KBD: Keyboard init ok, '%s' mode\n", Keyboard->name); break; } else { k_printf("KBD: Keyboard init ***failed***, '%s' mode\n", Keyboard->name); } } Keyboard = Keyboard->next; } /* Rationalize the keyboard config. * This should probably be done elsewhere . . . */ config.console_keyb = (Keyboard == &Keyboard_raw); /* We always have a least Keyboard_none to fall back too */ if(Keyboard == NULL) Keyboard = &Keyboard_none; return TRUE; }