--- libsdl1.2-1.2.11.orig/src/video/fbcon/SDL_fbvideo.c
+++ libsdl1.2-1.2.11/src/video/fbcon/SDL_fbvideo.c
@@ -697,14 +697,19 @@
 		}
 	}
 
-	/* Enable mouse and keyboard support */
-	if ( FB_OpenKeyboard(this) < 0 ) {
-		FB_VideoQuit(this);
-		return(-1);
-	}
+	if (!SDL_getenv("SDL_NOKBD"))
+	  {
+	    fprintf(stderr, "init kbd.\n");
+	    /* Enable mouse and keyboard support */
+	    if ( FB_OpenKeyboard(this) < 0 ) {
+	      FB_VideoQuit(this);
+	      return(-1);
+	    }
+	  }
 	if ( FB_OpenMouse(this) < 0 ) {
 		const char *sdl_nomouse;
 
+		fprintf(stderr, "init mouse failed.\n");
 		sdl_nomouse = SDL_getenv("SDL_NOMOUSE");
 		if ( ! sdl_nomouse ) {
 			SDL_SetError("Unable to open mouse");
@@ -914,7 +920,6 @@
 
 	/* Set the terminal into graphics mode */
 	if ( FB_EnterGraphicsMode(this) < 0 ) {
-		return(NULL);
 	}
 
 	/* Restore the original palette */
@@ -1620,7 +1626,7 @@
 
 	if ( this->screen ) {
 		/* Clear screen and tell SDL not to free the pixels */
-		if ( this->screen->pixels && FB_InGraphicsMode(this) ) {
+	  if ( this->screen->pixels && (FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD")) ) {
 #if defined(__powerpc__) || defined(__ia64__)	/* SIGBUS when using SDL_memset() ?? */
 			Uint8 *rowp = (Uint8 *)this->screen->pixels;
 			int left = this->screen->pitch*this->screen->h;
@@ -1669,7 +1675,7 @@
 		}
 
 		/* Restore the original video mode and palette */
-		if ( FB_InGraphicsMode(this) ) {
+		if ( FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD") ) {
 			FB_RestorePalette(this);
 			ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
 		}


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to