0003-add-SDL_NOKBD.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
  2. index 5e58809..81830b6 100644
  3. --- a/src/video/fbcon/SDL_fbvideo.c
  4. +++ b/src/video/fbcon/SDL_fbvideo.c
  5. @@ -793,9 +793,11 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
  6. }
  7. /* Enable mouse and keyboard support */
  8. - if ( FB_OpenKeyboard(this) < 0 ) {
  9. - FB_VideoQuit(this);
  10. - return(-1);
  11. + if (!SDL_getenv("SDL_NOKBD")){
  12. + if ( FB_OpenKeyboard(this) < 0 ) {
  13. + FB_VideoQuit(this);
  14. + return(-1);
  15. + }
  16. }
  17. if ( FB_OpenMouse(this) < 0 ) {
  18. const char *sdl_nomouse;
  19. @@ -944,7 +946,7 @@ static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
  20. /* Set the terminal into graphics mode */
  21. if ( FB_EnterGraphicsMode(this) < 0 ) {
  22. - return(NULL);
  23. + if (!SDL_getenv("SDL_NOKBD")) return(NULL);
  24. }
  25. /* Restore the original palette */
  26. @@ -1009,7 +1011,7 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
  27. /* Set the terminal into graphics mode */
  28. if ( FB_EnterGraphicsMode(this) < 0 ) {
  29. - return(NULL);
  30. + if (!SDL_getenv("SDL_NOKBD")) return(NULL);
  31. }
  32. /* Restore the original palette */
  33. @@ -1919,7 +1921,7 @@ static void FB_VideoQuit(_THIS)
  34. SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h);
  35. }
  36. - if ( !dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this) ) {
  37. + if ( (!dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this)) || SDL_getenv("SDL_NOKBD") ) {
  38. #if defined(__powerpc__) || defined(__ia64__) /* SIGBUS when using SDL_memset() ?? */
  39. Uint8 *rowp = (Uint8 *)this->screen->pixels;
  40. int left = this->screen->pitch*this->screen->h;
  41. @@ -1968,7 +1970,7 @@ static void FB_VideoQuit(_THIS)
  42. }
  43. /* Restore the original video mode and palette */
  44. - if ( FB_InGraphicsMode(this) ) {
  45. + if ( FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD") ) {
  46. FB_RestorePalette(this);
  47. ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
  48. }