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

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: 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 f9186ca0c885701107feb19f746d54bcc88a3993..7378b5a36e5a0b7864d9e0df58b3268cac52ffc1 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(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.
+unsigned int XKeyEventKeyCode(ui::KeyboardCode key_code,
Daniel Erat 2014/07/07 21:07:01 does this need to be exported like all the other f
kpschoedel 2014/07/08 14:40:21 Done. I have work in progress under crbug.com/380
+ int flags,
+ XDisplay* display);
+
// Converts an X keycode into ui::KeyboardCode.
EVENTS_BASE_EXPORT KeyboardCode
DefaultKeyboardCodeFromHardwareKeycode(unsigned int hardware_code);

Powered by Google App Engine
This is Rietveld 408576698