Themaister/RetroArch — pull request #72 by meancoot (2012-11-26 01:35:48+00:00)
Title: Allow libretro core to receive keyboard input using events rather than polling.

I've attached a half-ass attempt at how it could be implemented for SDL builds.

The scheme is simple, the core prepares a structure containing a pointer to an event callback function, then passes it as the argument with RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK.

If the callback is set the frontend calls the provided callback in response to keyboard events.

The advantages are:
* The core doesn't have to poll all of the keys every frame.

* The unicode character for the keypress is sent with the event to allow for the OS to translate key press into character info based on the systems keyboard layout (This is particularly important for things like ScummVM).