 +    event->x = mouse_event->GetPosition().x();
 +    event->y = mouse_event->GetPosition().y();
 +  } else if (event->type == PP_INPUTEVENT_TYPE_KEYDOWN || 
-+             event->type == PP_INPUTEVENT_TYPE_KEYUP) {
++             event->type == PP_INPUTEVENT_TYPE_KEYUP ||
++             event->type == PP_INPUTEVENT_TYPE_CHAR) {
++    // PPAPI sends us separate events for KEYDOWN and CHAR; the first one
++    // contains only the keycode, the second one - only the unicode text.
++    // SDL wants both in SDL_PRESSED event :(
++    // For now, we just send an extra SDL_PRESSED with unicode text and zero keycode for CHAR.
++    // It seems that SDL 1.3 is better in this regard.
 +    pp::KeyboardInputEvent *keyboard_event =
 +      reinterpret_cast<pp::KeyboardInputEvent*>(input_event);
-+    keysym.scancode = 0;
-+    keysym.sym = translateKey(keyboard_event->GetKeyCode());
++    keysym.scancode = keyboard_event->GetKeyCode();
++    keysym.sym = translateKey(keysym.scancode);
 +    keysym.mod = KMOD_NONE;
-+    keysym.unicode = 0;
++    keysym.unicode = keyboard_event->GetCharacterText().AsString()[0];
 +    event->keysym = keysym;
 +  } else {
 +    return;

+  return 1;
+}
+} // extern "C"
diff -Naur temp_SDL-1.2.14/SDL-1.2.14/src/audio/nacl/SDL_naclaudio.h SDL-1.2.14/src/audio/nacl/SDL_naclaudio.h
--- temp_SDL-1.2.14/SDL-1.2.14/src/audio/nacl/SDL_naclaudio.h	1969-12-31 16:00:00.000000000 -0800
+++ SDL-1.2.14/src/audio/nacl/SDL_naclaudio.h	2011-07-27 15:59:13.000000000 -0700
@@ -0,0 +1,30 @@
+#include "SDL_config.h"
+

+};
+
+#endif /* _SDL_naclvideo_h */
diff -urN SDL-1.2.14/src/video/nacl/eventqueue.h SDL-1.2.14-nacl/src/video/nacl/eventqueue.h
--- SDL-1.2.14/src/video/nacl/eventqueue.h	1970-01-01 03:00:00.000000000 +0300
+++ SDL-1.2.14-nacl/src/video/nacl/eventqueue.h	2011-10-13 15:43:08.987128198 +0400
@@ -0,0 +1,43 @@
+#ifndef _SDL_nacl_eventqueue_h
+#define _SDL_nacl_eventqueue_h
