diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 17:26:05 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 17:26:05 +0000 |
commit | bb2bd5ee717347ba0ed7d6e93870bf20fee88789 (patch) | |
tree | 2afa508bc9bd911ff0008ac0d57ed8fae6c031fc /ppapi/example | |
parent | a5dc53d8900e1808d707008b2911ae3adc03db38 (diff) | |
download | chromium_src-bb2bd5ee717347ba0ed7d6e93870bf20fee88789.zip chromium_src-bb2bd5ee717347ba0ed7d6e93870bf20fee88789.tar.gz chromium_src-bb2bd5ee717347ba0ed7d6e93870bf20fee88789.tar.bz2 |
Revert Pepper Key event "USB code" CL.
Revert "Expose scancodes to PP_InputEvent_Key events that are independent of the input language/layout in effect, i.e. that represent the physical key pressed, independent of its meaning in the current context."
This reverts commit 35b9f7f01686f51142d8d5b16a88d04575113029.
BUG=
TEST=
Review URL: http://codereview.chromium.org/6902020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83034 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/example')
-rw-r--r-- | ppapi/example/example.cc | 20 | ||||
-rw-r--r-- | ppapi/example/example.html | 1 |
2 files changed, 1 insertions, 20 deletions
diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc index 6f5c950..a47d365 100644 --- a/ppapi/example/example.cc +++ b/ppapi/example/example.cc @@ -10,7 +10,6 @@ #include <time.h> #include <algorithm> -#include <sstream> #include "ppapi/c/dev/ppb_console_dev.h" #include "ppapi/c/dev/ppb_cursor_control_dev.h" @@ -18,7 +17,6 @@ #include "ppapi/c/pp_errors.h" #include "ppapi/c/pp_input_event.h" #include "ppapi/c/pp_rect.h" -#include "ppapi/c/ppb_var.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/dev/scriptable_object_deprecated.h" #include "ppapi/cpp/graphics_2d.h" @@ -29,6 +27,7 @@ #include "ppapi/cpp/rect.h" #include "ppapi/cpp/url_loader.h" #include "ppapi/cpp/url_request_info.h" +#include "ppapi/cpp/var.h" static const int kStepsPerCircle = 800; @@ -195,22 +194,6 @@ class MyInstance : public pp::InstancePrivate, public MyFetcherClient { return true; } - void HandleKeyEvent(const PP_InputEvent_Key& key_event) { - Log(PP_LOGLEVEL_LOG, "HandleKeyDownEvent"); - - // Stringify the Windows-style and Native key codes - std::ostringstream last_key_down_text; - last_key_down_text << "vkey=" << key_event.key_code - << " native=" << key_event.native_key_code - << " usb=" << std::hex << key_event.usb_key_code; - - // Locate the field to update in the page DOM - pp::VarPrivate window = GetWindowObject(); - pp::VarPrivate doc = window.GetProperty("document"); - pp::VarPrivate last_key_down = doc.Call("getElementById", "lastKeyDown"); - last_key_down.SetProperty("innerHTML", last_key_down_text.str()); - } - virtual bool HandleInputEvent(const PP_InputEvent& event) { switch (event.type) { case PP_INPUTEVENT_TYPE_MOUSEDOWN: @@ -220,7 +203,6 @@ class MyInstance : public pp::InstancePrivate, public MyFetcherClient { case PP_INPUTEVENT_TYPE_MOUSEMOVE: return true; case PP_INPUTEVENT_TYPE_KEYDOWN: - HandleKeyEvent(event.u.key); return true; default: return false; diff --git a/ppapi/example/example.html b/ppapi/example/example.html index bd056d6..7146b3f 100644 --- a/ppapi/example/example.html +++ b/ppapi/example/example.html @@ -33,7 +33,6 @@ function ToggleSize() { <button onclick='Test()'>Test</button> <button onclick='ToggleSize()'>Toggle Size</button> <div id="fps" style="background-color:white; font-weight:bold; padding:4px; width:200px;">FPS GOES HERE</div> - <div id="lastKeyDown" style="background-color:white; font-weight:bold; padding:4px; width:200px;">LAST KEY DOWN GOES HERE</div> <div id="size" style="background-color:white; font-weight:bold; padding:4px; width:200px;"></div> <object id="plugin" type="application/x-ppapi-example" width="400" height="400" border="2px"></object> <hr> |