[EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 09:12:32 +0000 (09:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 09:12:32 +0000 (09:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85503

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 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
LayoutTests/platform/efl/Skipped
Source/WebCore/ChangeLog
Source/WebCore/platform/efl/EflKeyboardUtilities.cpp

index 49723c7..cb3658a 100644 (file)
@@ -1,3 +1,14 @@
+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.
+
+        Bug-related testcases are unskipped.
+
+        * platform/efl/Skipped:
+
 2012-05-16  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL] Tests that require DASHBOARD_SUPPORT should be moved to test expectations
index 275c135..bb52882 100644 (file)
@@ -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
index 0e86baa..f95dfde 100644 (file)
@@ -1,3 +1,18 @@
+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.
index 9e8eb10..58c058f 100644 (file)
@@ -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;
 }