+2012-05-16 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling
+ https://bugs.webkit.org/show_bug.cgi?id=85503
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * platform/efl/EflKeyboardUtilities.cpp:
+ (WebCore::addCharactersToKeyMap): aux function
+ (WebCore):
+ (WebCore::createKeyMap): Figures and letters keys are added to the keyMap
+ (WebCore::addCharactersToWinKeyMap): aux function
+ (WebCore::createWindowsKeyMap): Capital letters keys are added to the windowsKeyMap. Corrected value for printscreen key.
+ (WebCore::singleCharacterString): Return empty text for printscreen key.
+
2012-05-16 Pavel Feldman <pfeldman@chromium.org>
Web Inspector: rename DebuggerPresentationModel to DebuggerScriptMapping, make it private to ScriptsPanel.
return windowsKeyMap;
}
+static inline void addCharactersToKeyMap(const char from, const char to)
+{
+ for (char c = from; c <= to; c++)
+ keyMap().set(String(&c, 1), String::format("U+%04X", c));
+}
+
static void createKeyMap()
{
for (unsigned int i = 1; i < 25; i++) {
keyMap().set("ISO_Left_Tab", "U+0009");
keyMap().set("BackSpace", "U+0008");
keyMap().set("space", "U+0020");
+ keyMap().set("Print", "PrintScreen");
// Keypad location
keyMap().set("KP_Left", "Left");
keyMap().set("KP_Right", "Right");
keyMap().set("KP_End", "End");
keyMap().set("KP_Insert", "Insert");
keyMap().set("KP_Delete", "U+007F");
+
+ addCharactersToKeyMap('a', 'z');
+ addCharactersToKeyMap('A', 'Z');
+ addCharactersToKeyMap('0', '9');
+}
+
+static inline void addCharactersToWinKeyMap(const char from, const char to, const int baseCode)
+{
+ int i = 0;
+ for (char c = from; c <= to; c++, i++)
+ windowsKeyMap().set(String(&c, 1), baseCode + i);
}
static void createWindowsKeyMap()
windowsKeyMap().set("Left", VK_LEFT);
windowsKeyMap().set("Up", VK_UP);
windowsKeyMap().set("Down", VK_DOWN);
- windowsKeyMap().set("Print", VK_PRINT);
+ windowsKeyMap().set("Print", VK_SNAPSHOT);
windowsKeyMap().set("Insert", VK_INSERT);
windowsKeyMap().set("Delete", VK_DELETE);
windowsKeyMap().set("KP_Delete", VK_DELETE);
// Set alphabet to the windowsKeyMap.
- const char* alphabet = "abcdefghijklmnopqrstuvwxyz";
- for (unsigned int i = 0; i < 26; i++) {
- String key(alphabet + i, 1);
- windowsKeyMap().set(key, VK_A + i);
- }
+ addCharactersToWinKeyMap('a', 'z', VK_A);
+ addCharactersToWinKeyMap('A', 'Z', VK_A);
// Set digits to the windowsKeyMap.
- for (unsigned int i = 0; i < 10; i++) {
- String key = String::number(i);
- windowsKeyMap().set(key, VK_0 + i);
- }
+ addCharactersToWinKeyMap('0', '9', VK_0);
// Set shifted digits to the windowsKeyMap.
windowsKeyMap().set("exclam", VK_1);
return String("\x8");
if (keyName == "Tab")
return String("\t");
+ if (keyName == "Print")
+ return String("");
return keyName;
}