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

Unified Diff: ui/events/keycodes/keyboard_code_conversion_x.h

Issue 378503007: Fix some surprising reverse key mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase (merges XI2) Created 6 years, 5 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
Index: ui/events/keycodes/keyboard_code_conversion_x.h
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.h b/ui/events/keycodes/keyboard_code_conversion_x.h
index 9708a1bde26bd86cae5d62ca77b56947e9bf66ad..162669124db09331d99dc7b68dae7606b1462b37 100644
--- a/ui/events/keycodes/keyboard_code_conversion_x.h
+++ b/ui/events/keycodes/keyboard_code_conversion_x.h
@@ -10,6 +10,7 @@
#include "ui/events/keycodes/keyboard_codes_posix.h"
typedef union _XEvent XEvent;
+typedef struct _XDisplay XDisplay;
namespace ui {
@@ -26,6 +27,14 @@ EVENTS_BASE_EXPORT uint16 GetCharacterFromXEvent(const XEvent* xev);
EVENTS_BASE_EXPORT int XKeysymForWindowsKeyCode(KeyboardCode keycode,
bool shift);
+// Returns a XKeyEvent keycode (scancode) for a KeyboardCode. Keyboard layouts
+// are usually not injective, so inverse mapping should be avoided when
+// practical. A round-trip keycode -> KeyboardCode -> keycode will not
+// necessarily return the original keycode.
+EVENTS_BASE_EXPORT unsigned int XKeyCodeForWindowsKeyCode(KeyboardCode key_code,
+ int flags,
+ XDisplay* display);
+
// Converts an X keycode into ui::KeyboardCode.
EVENTS_BASE_EXPORT KeyboardCode
DefaultKeyboardCodeFromHardwareKeycode(unsigned int hardware_code);
« no previous file with comments | « chrome/browser/chromeos/events/event_rewriter_unittest.cc ('k') | ui/events/keycodes/keyboard_code_conversion_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698