Changeset 117238 in webkit


Ignore:
Timestamp:
May 16, 2012 2:12:32 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling
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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117237 r117238  
     12012-05-16  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        [EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling
     4        https://bugs.webkit.org/show_bug.cgi?id=85503
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Bug-related testcases are unskipped.
     9
     10        * platform/efl/Skipped:
     11
    1122012-05-16  Christophe Dumez  <christophe.dumez@intel.com>
    213
  • trunk/LayoutTests/platform/efl/Skipped

    r117237 r117238  
    800800fast/events/key-events-in-input-text.html
    801801fast/events/option-tab.html
    802 fast/events/special-key-events-in-input-text.html
    803 fast/forms/enter-clicks-buttons.html
    804802fast/forms/input-search-press-escape-key.html
    805803
  • trunk/Source/WebCore/ChangeLog

    r117235 r117238  
     12012-05-16  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        [EFL] PlatformKeyboardEvent: figures, letters and printscreen key handling
     4        https://bugs.webkit.org/show_bug.cgi?id=85503
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        * platform/efl/EflKeyboardUtilities.cpp:
     9        (WebCore::addCharactersToKeyMap): aux function
     10        (WebCore):
     11        (WebCore::createKeyMap): Figures and letters keys are added to the keyMap
     12        (WebCore::addCharactersToWinKeyMap): aux function
     13        (WebCore::createWindowsKeyMap): Capital letters keys are added to the windowsKeyMap. Corrected value for printscreen key.
     14        (WebCore::singleCharacterString): Return empty text for printscreen key.
     15
    1162012-05-16  Pavel Feldman  <pfeldman@chromium.org>
    217
  • trunk/Source/WebCore/platform/efl/EflKeyboardUtilities.cpp

    r116452 r117238  
    5151}
    5252
     53static inline void addCharactersToKeyMap(const char from, const char to)
     54{
     55    for (char c = from; c <= to; c++)
     56        keyMap().set(String(&c, 1), String::format("U+%04X", c));
     57}
     58
    5359static void createKeyMap()
    5460{
     
    7985    keyMap().set("BackSpace", "U+0008");
    8086    keyMap().set("space", "U+0020");
     87    keyMap().set("Print", "PrintScreen");
    8188    // Keypad location
    8289    keyMap().set("KP_Left", "Left");
     
    9097    keyMap().set("KP_Insert", "Insert");
    9198    keyMap().set("KP_Delete", "U+007F");
     99 
     100    addCharactersToKeyMap('a', 'z');
     101    addCharactersToKeyMap('A', 'Z');
     102    addCharactersToKeyMap('0', '9');
     103}
     104
     105static inline void addCharactersToWinKeyMap(const char from, const char to, const int baseCode)
     106{
     107    int i = 0;
     108    for (char c = from; c <= to; c++, i++)
     109        windowsKeyMap().set(String(&c, 1), baseCode + i);
    92110}
    93111
     
    121139    windowsKeyMap().set("Up", VK_UP);
    122140    windowsKeyMap().set("Down", VK_DOWN);
    123     windowsKeyMap().set("Print", VK_PRINT);
     141    windowsKeyMap().set("Print", VK_SNAPSHOT);
    124142    windowsKeyMap().set("Insert", VK_INSERT);
    125143    windowsKeyMap().set("Delete", VK_DELETE);
     
    156174
    157175    // Set alphabet to the windowsKeyMap.
    158     const char* alphabet = "abcdefghijklmnopqrstuvwxyz";
    159     for (unsigned int i = 0; i < 26; i++) {
    160         String key(alphabet + i, 1);
    161         windowsKeyMap().set(key, VK_A + i);
    162     }
     176    addCharactersToWinKeyMap('a', 'z', VK_A);
     177    addCharactersToWinKeyMap('A', 'Z', VK_A);
    163178
    164179    // Set digits to the windowsKeyMap.
    165     for (unsigned int i = 0; i < 10; i++) {
    166         String key = String::number(i);
    167         windowsKeyMap().set(key, VK_0 + i);
    168     }
     180    addCharactersToWinKeyMap('0', '9', VK_0);
    169181
    170182    // Set shifted digits to the windowsKeyMap.
     
    210222    if (keyName == "Tab")
    211223        return String("\t");
     224    if (keyName == "Print")
     225        return String("");
    212226    return keyName;
    213227}
Note: See TracChangeset for help on using the changeset viewer.