[Webkit-unassigned] [Bug 85503] [EFL]PlatformKeyboardEvent: figures, letters and printscreen key handling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun May 6 18:20:06 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=85503





--- Comment #5 from Raphael Kubo da Costa (rakuco) <rakuco at webkit.org>  2012-05-06 18:20:06 PST ---
(From update of attachment 140168)
View in context: https://bugs.webkit.org/attachment.cgi?id=140168&action=review

Are there more commits related to adding keys to this file in your queue?

> LayoutTests/ChangeLog:3
> +        [EFL]PlatformKeyboardEvent: figures, letters and printscreen key handling

Nit: '[EFL] foo' instead of '[EFL]foo'

> Source/WebCore/ChangeLog:3
> +        [EFL]PlatformKeyboardEvent: figures, letters and printscreen key handling

Ditto.

> Source/WebCore/ChangeLog:9
> +        Corrected valure for printscreen key in the windowsKeyMap.

Nit: s/valure/value/.

> Source/WebCore/ChangeLog:10
> +        Figures and letters keys are added to the keyMap.
> +        Corrected valure for printscreen key in the windowsKeyMap.
> +        Capital letters keys are added to the windowsKeyMap.

This description can be moved to the respective methods they are related to below.

> Source/WebCore/platform/efl/EflKeyboardUtilities.cpp:97
> +    // Set alphabet to the keyMap.
> +    const char* lows = "abcdefghijklmnopqrstuvwxyz";
> +    const char* caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> +    const int lowsBase = static_cast<int>(*lows);
> +    const int capsBase = static_cast<int>(*caps);
> +
> +    for (unsigned int i = 0; i < 26; i++) {
> +        keyMap().set(String(lows + i, 1), String::format("U+%04X", lowsBase + i));
> +        keyMap().set(String(caps + i, 1), String::format("U+%04X", capsBase + i));
> +    }
> +
> +    // Set digits to the keyMap
> +    const int digitBase = static_cast<int>('0');
> +    for (unsigned int i = 0; i < 10; i++)
> +        keyMap().set(String::number(i), String::format("U+%04X", digitBase + i));

How about

  static void addCharacterToKeyMap(char character)
  {
      keyMap().set(String(&character, 1), String::format("U+%04X", character));
  }

  static void createKeyMap()
  {
      // ...

      for (char c = 'a'; c <= 'z'; c++)
          addCharacterToKeyMap(c);
      for (char c = 'A'; c <= 'Z'; c++)
          addCharacterToKeyMap(c);
      for (char c = '0'; c <= '9'; c++)
          addCharacterToKeyMap(c);

      // ....
  }

> Source/WebCore/platform/efl/EflKeyboardUtilities.cpp:155
> -    const char* alphabet = "abcdefghijklmnopqrstuvwxyz";
> +    const char* lows = "abcdefghijklmnopqrstuvwxyz";
> +    const char* caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
>      for (unsigned int i = 0; i < 26; i++) {

This can be simplified in a way similar to the one I described above.

> Source/WebCore/platform/efl/EflKeyboardUtilities.cpp:209
> +    if (keyName == "Print")
> +        return String("");

Are you sure this is correct? Neither the Qt nor the GTK+ port does something similar.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list