Keyboard not working at all Topic actions First post, by Bitou Posted on 2009-12-22, 15:17 Bitou Offline User metadata Posts 3 Joined 2009-12-22, 14:17 Rank Newbie Rank Newbie Posts 3 Joined 2009-12-22, 14:17 Hello, I have just installed DosBox 0.73, but when I launch it, I cannot type anything in the DOS window. It is just as if I had no keyboard at all. Is this a known bug ? Or I am missing something with the configuration ? I am running Windows Seven x64. Reply 1 of 3, by Bitou Posted on 2009-12-22, 21:14 Bitou Offline User metadata Posts 3 Joined 2009-12-22, 14:17 Rank Newbie Rank Newbie Posts 3 Joined 2009-12-22, 14:17 I built the code and found in sdlmain.cpp a block of code that makes DosBox behaving crazily about keyboard events. Copy code to clipboard1if (getenv("SDL_VIDEODRIVER")==NULL) {2 if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) {3 sdl.using_windib=false;4 if (strcmp(sdl_drv_name,"directx")!=0) {5 SDL_QuitSubSystem(SDL_INIT_VIDEO);6 putenv("SDL_VIDEODRIVER=directx");7 if (SDL_InitSubSystem(SDL_INIT_VIDEO)<0) {8 putenv("SDL_VIDEODRIVER=windib");9 if (SDL_InitSubSystem(SDL_INIT_VIDEO)<0) E_Exit("Can't init SDL Video %s",SDL_GetError());10 sdl.using_windib=true;11 }12 }13 } If I remove this block, I get everything working. That's a first clue. Reply 2 of 3, by DosFreak Posted on 2009-12-22, 21:21 DosFreak Offline User metadata Posts 13202 Joined 2002-06-30, 16:35 Location Milliways Rank l33t++ Rank l33t++ Posts 13202 Joined 2002-06-30, 16:35 Location Milliways Try setting SDL_Videodriver=windib variable before starting DOSBox. That will probably fix you're keyboard issue. Removing the above code probably does the same thing. (DOSBox tries to force DirectX whereas SDL default is to use WINDIB) Last edited by DosFreak on 2009-12-22, 21:48. Edited 1 time in total. How To Ask Questions The Smart Way Make your games work offline Reply 3 of 3, by Bitou Posted on 2009-12-22, 21:41 Bitou Offline User metadata Posts 3 Joined 2009-12-22, 14:17 Rank Newbie Rank Newbie Posts 3 Joined 2009-12-22, 14:17 Indeed, setting SDL_VIDEODRIVER=windib before running DosBox works. It will be a good workaround until I find the root cause (SDL ? x64 drivers ?). Go to top of page Go to top of page Back to DOSBox Development
Reply 1 of 3, by Bitou Posted on 2009-12-22, 21:14 Bitou Offline User metadata Posts 3 Joined 2009-12-22, 14:17 Rank Newbie Rank Newbie Posts 3 Joined 2009-12-22, 14:17 I built the code and found in sdlmain.cpp a block of code that makes DosBox behaving crazily about keyboard events. Copy code to clipboard1if (getenv("SDL_VIDEODRIVER")==NULL) {2 if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) {3 sdl.using_windib=false;4 if (strcmp(sdl_drv_name,"directx")!=0) {5 SDL_QuitSubSystem(SDL_INIT_VIDEO);6 putenv("SDL_VIDEODRIVER=directx");7 if (SDL_InitSubSystem(SDL_INIT_VIDEO)<0) {8 putenv("SDL_VIDEODRIVER=windib");9 if (SDL_InitSubSystem(SDL_INIT_VIDEO)<0) E_Exit("Can't init SDL Video %s",SDL_GetError());10 sdl.using_windib=true;11 }12 }13 } If I remove this block, I get everything working. That's a first clue.
Reply 2 of 3, by DosFreak Posted on 2009-12-22, 21:21 DosFreak Offline User metadata Posts 13202 Joined 2002-06-30, 16:35 Location Milliways Rank l33t++ Rank l33t++ Posts 13202 Joined 2002-06-30, 16:35 Location Milliways Try setting SDL_Videodriver=windib variable before starting DOSBox. That will probably fix you're keyboard issue. Removing the above code probably does the same thing. (DOSBox tries to force DirectX whereas SDL default is to use WINDIB) Last edited by DosFreak on 2009-12-22, 21:48. Edited 1 time in total. How To Ask Questions The Smart Way Make your games work offline
Reply 3 of 3, by Bitou Posted on 2009-12-22, 21:41 Bitou Offline User metadata Posts 3 Joined 2009-12-22, 14:17 Rank Newbie Rank Newbie Posts 3 Joined 2009-12-22, 14:17 Indeed, setting SDL_VIDEODRIVER=windib before running DosBox works. It will be a good workaround until I find the root cause (SDL ? x64 drivers ?).