Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: ui/base/keycodes/keyboard_code_conversion_x.cc

Issue 8380033: aura: Fix shift/ctrl/alt keyevents with RWHVA and X11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_x.h ('k') | views/events/event_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/keyboard_code_conversion_x.cc
diff --git a/ui/base/keycodes/keyboard_code_conversion_x.cc b/ui/base/keycodes/keyboard_code_conversion_x.cc
index 4235fca327cbfef0ca8de8c7fdd9aef219b9ffe0..494caffcc687bbe5ea93e2a1de175908855d60a2 100644
--- a/ui/base/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/base/keycodes/keyboard_code_conversion_x.cc
@@ -6,9 +6,11 @@
#include <X11/keysym.h>
#include <X11/Xlib.h>
+#include <X11/Xutil.h>
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/utf_string_conversions.h"
namespace ui {
@@ -289,6 +291,16 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) {
return VKEY_UNKNOWN;
}
+unsigned int DefaultSymbolFromXEvent(XEvent* xev) {
+ char buf[6];
+ int bytes_written = XLookupString(&xev->xkey, buf, 6, NULL, NULL);
+ DCHECK_LE(bytes_written, 6);
+
+ string16 result;
+ return (bytes_written > 0 && UTF8ToUTF16(buf, bytes_written, &result) &&
+ result.length() == 1) ? result[0] : 0;
+}
+
unsigned int DefaultXKeysymFromHardwareKeycode(unsigned int hardware_code) {
static const unsigned int kHardwareKeycodeMap[] = {
0, // 0x00:
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_x.h ('k') | views/events/event_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698