From 346002d015960672ab7ac0217e280f4149c957c3 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Wed, 16 May 2012 09:12:32 +0000 Subject: [PATCH] [EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling https://bugs.webkit.org/show_bug.cgi?id=85503 Patch by Mikhail Pozdnyakov on 2012-05-16 Reviewed by Gustavo Noronha Silva. Source/WebCore: * 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. LayoutTests: Bug-related testcases are unskipped. * platform/efl/Skipped: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117238 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 11 +++++++ LayoutTests/platform/efl/Skipped | 2 -- Source/WebCore/ChangeLog | 15 ++++++++++ .../WebCore/platform/efl/EflKeyboardUtilities.cpp | 34 +++++++++++++++------- 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 49723c7..cb3658a 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2012-05-16 Mikhail Pozdnyakov + + [EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling + https://bugs.webkit.org/show_bug.cgi?id=85503 + + Reviewed by Gustavo Noronha Silva. + + Bug-related testcases are unskipped. + + * platform/efl/Skipped: + 2012-05-16 Christophe Dumez [EFL] Tests that require DASHBOARD_SUPPORT should be moved to test expectations diff --git a/LayoutTests/platform/efl/Skipped b/LayoutTests/platform/efl/Skipped index 275c135..bb52882 100644 --- a/LayoutTests/platform/efl/Skipped +++ b/LayoutTests/platform/efl/Skipped @@ -799,8 +799,6 @@ fast/events/drag-parent-node.html fast/events/key-events-in-input-button.html fast/events/key-events-in-input-text.html fast/events/option-tab.html -fast/events/special-key-events-in-input-text.html -fast/forms/enter-clicks-buttons.html fast/forms/input-search-press-escape-key.html # BUG: not scrolling correctly diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 0e86baa..f95dfde 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-05-16 Mikhail Pozdnyakov + + [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 Web Inspector: rename DebuggerPresentationModel to DebuggerScriptMapping, make it private to ScriptsPanel. diff --git a/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp b/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp index 9e8eb10..58c058f 100644 --- a/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp +++ b/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp @@ -50,6 +50,12 @@ static WindowsKeyMap& windowsKeyMap() 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++) { @@ -78,6 +84,7 @@ static void createKeyMap() 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"); @@ -89,6 +96,17 @@ static void createKeyMap() 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() @@ -120,7 +138,7 @@ 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); @@ -155,17 +173,11 @@ static void createWindowsKeyMap() 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); @@ -209,6 +221,8 @@ String singleCharacterString(const String& keyName) return String("\x8"); if (keyName == "Tab") return String("\t"); + if (keyName == "Print") + return String(""); return keyName; } -- 2.7.4