 +    case 191:
 +      return SDLK_SLASH;
 +    case 192:
-+      return SDLK_BACKQUOTE;
-+    default:
++      return SDLK_BACKQUOTE;    default:
 +      return SDLK_UNKNOWN;
 +  }
 +}
 +
++void SDL_NACL_PushEvent(pp::InputEvent *ppevent) {
++  SDL_keysym keysym;
++  struct SDL_NACL_Event* event =
++    (struct SDL_NACL_Event*)malloc(sizeof(struct SDL_NACL_Event));
++  event->type = ppevent->GetType();
++
++  if (event->type == PP_INPUTEVENT_TYPE_MOUSEDOWN ||
++      event->type == PP_INPUTEVENT_TYPE_MOUSEUP) {
++    pp::MouseInputEvent *mouse_event =
++      reinterpret_cast<pp::MouseInputEvent*>(ppevent);
++    event->button = translateButton(mouse_event->GetButton());
++  } else if (event->type == PP_INPUTEVENT_TYPE_MOUSEMOVE) {
++    pp::MouseInputEvent *mouse_event =
++      reinterpret_cast<pp::MouseInputEvent*>(ppevent);
++    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) {
++    pp::KeyboardInputEvent *keyboard_event =
++      reinterpret_cast<pp::KeyboardInputEvent*>(ppevent);
++    keysym.scancode = 0;
++    keysym.sym = translateKey(keyboard_event->GetKeyCode());
++    keysym.mod = KMOD_NONE;
++    keysym.unicode = 0;
++    event->keysym = keysym;
++  } else {
++    return;
++  }
++  event_queue.PushEvent(event);
++}
++
 +void NACL_PumpEvents(_THIS) {
-+  PP_InputEvent* event;
-+  SDL_keysym keysym;
++  SDL_NACL_Event* event;
 +  while (event = event_queue.PopEvent()) {
 +    if (event->type == PP_INPUTEVENT_TYPE_MOUSEDOWN) {
-+      SDL_PrivateMouseButton(SDL_PRESSED, translateButton(event->u.mouse.button), 0, 0);
++      SDL_PrivateMouseButton(SDL_PRESSED, event->button, 0, 0);
 +    } else if (event->type == PP_INPUTEVENT_TYPE_MOUSEUP) {
-+      SDL_PrivateMouseButton(SDL_RELEASED, translateButton(event->u.mouse.button), 0, 0);
++      SDL_PrivateMouseButton(SDL_RELEASED, event->button, 0, 0);
 +    } else if (event->type == PP_INPUTEVENT_TYPE_MOUSEMOVE) {
-+      SDL_PrivateMouseMotion(0, 0, event->u.mouse.x, event->u.mouse.y);
++      SDL_PrivateMouseMotion(0, 0, event->x, event->y);
 +    } else if (event->type == PP_INPUTEVENT_TYPE_KEYDOWN) {
-+      keysym.scancode = 0;
-+      keysym.sym = translateKey(event->u.key.key_code);
-+      keysym.mod = KMOD_NONE;
-+      keysym.unicode = 0;
-+      SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
++      SDL_PrivateKeyboard(SDL_PRESSED, &event->keysym);
 +    } else if (event->type == PP_INPUTEVENT_TYPE_KEYUP) {
-+      keysym.scancode = 0;
-+      keysym.sym = translateKey(event->u.key.key_code);
-+      keysym.mod = KMOD_NONE;
-+      keysym.unicode = 0;
-+      SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
++      SDL_PrivateKeyboard(SDL_RELEASED, &event->keysym);
 +    }
 +    free(event);
 +  }

+};
+
+#endif /* _SDL_naclaudio_h */
diff -urN SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.14-nacl/src/cpuinfo/SDL_cpuinfo.c
--- SDL-1.2.14/src/cpuinfo/SDL_cpuinfo.c	2009-10-13 03:07:14.000000000 +0400
+++ SDL-1.2.14-nacl/src/cpuinfo/SDL_cpuinfo.c	2011-05-27 12:35:37.274169187 +0400
@@ -53,6 +53,8 @@
 }
 #endif /* HAVE_SETJMP */

+
+extern void NACL_InitOSKeymap(_THIS);
+extern void NACL_PumpEvents(_THIS);
diff -Naur temp_SDL-1.2.14/SDL-1.2.14/src/video/nacl/SDL_naclvideo.cc SDL-1.2.14/src/video/nacl/SDL_naclvideo.cc
--- temp_SDL-1.2.14/SDL-1.2.14/src/video/nacl/SDL_naclvideo.cc	1969-12-31 16:00:00.000000000 -0800
+++ SDL-1.2.14/src/video/nacl/SDL_naclvideo.cc	2011-07-29 15:42:09.000000000 -0700
@@ -0,0 +1,325 @@
+#include "SDL_config.h"
+
+#include <assert.h>
