Using Usb Keyboards With Sdl ?


joyrider

Active Member
Joined
Mar 29, 2006
Messages
589
Age
43
Website
www.willemssoft.be
It seems usb keyboards should be supported by sdl however i can't get it working. The keyboard works flawlessly in the default gp2x menu. However it doesn't work and is unresponsive (leds do not turn on when pressing scroll,caps or numlock) whenever i start my game which is compiled with paeryn's latest prebuild hw lib. woogal thought you didn't had to do anything special to get them working with SDL but he wasn't sure perhaps someone here knows how i can make them work with the sdl libs ?

thanks

Also i always see the following message :

[root@gp2x dynamate]$./dynamate.gpe
SDL_GP2X: Looking for a mouse
Last mouse mode: 0x0
Using PS2 mouse

even though there is no mouse connected to the cradle, is this normal ?

edit:
hmm browsed through the sdl code, and i saw this in the SDL_gp2xvideo.c file. It seems the keyboard is commented out, is this done for a special reason, i guess if i uncomment it and recompile sdl, keyboards will start working again. but just would like to know if there was any special reason as to why it's commented out ?

352 GP2X_InitHWSurfaces(this);
353 // Enable mouse and keyboard support
354 // GP2X_OpenKeyboard(this);
355 GP2X_OpenMouse(this);
356 return 0;
357 }
 
It's commented out because I never got around to checking it, there was something wierd with GPH's code from what I can remember and back then there wasn't even a BoB.
I think I never got around to the keyboard part because I never had a spare USB keyboard to test it with. Nobody's mentioned it until now so I'd forgotten all about it. The keyboard code is in SDL_gp2xevents.c which needs un-commenting too, it might work as it stands - feel free to try, I'll look into it later tonight and get it enabled as soon as.
 
Back
Top