WebCore/dom/KeyboardEvent.cpp

2828#include "EventNames.h"
2929#include "EventHandler.h"
3030#include "Frame.h"
 31#include "KURL.h"
3132#include "PlatformKeyboardEvent.h"
3233#include "Settings.h"
 34#include "StringHash.h"
3335
3436namespace WebCore {
3537
 38// The number of hex digits for a Unicode code point is at least 4 according to section 6.3.1 of
 39// the DOM Level 3 spec., <http://www.w3.org/TR/DOM-Level-3-Events/#keyset-keyidentifiers>. However,
 40// since the spec. neither specifies a maximum number of hex digits nor defines any key identifier
 41// whose Unicode code point is written using more than 4 hex digits, we only look at the first 4 hex
 42// digits.
 43static unsigned const numUnicodeCodePointHexDigits = 4;
 44
3645static inline const AtomicString& eventTypeForKeyboardEventType(PlatformKeyboardEvent::Type type)
3746{
3847 switch (type) {

@@static inline const AtomicString& eventT
5059 return eventNames().keydownEvent;
5160}
5261
 62static HashMap<String, unsigned>* keyIdentifierList()
 63{
 64 typedef HashMap<String, unsigned> KeyIdentifierMap;
 65 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 66 if (keyIdentifierList.isEmpty()) {
 67 // "Backspace", "U+0008"
 68 keyIdentifierList.set("Backspace", 0x0008);
 69 // "Tab", "U+0009"
 70 keyIdentifierList.set("Tab", '\t');
 71 // "Cancel", "U+0018"
 72 keyIdentifierList.set("Cancel", 0x0018);
 73 // "Esc", "U+001B"
 74 keyIdentifierList.set("Esc", 0x001B);
 75 // "Spacebar", "U+0020"
 76 keyIdentifierList.set("Spacebar", ' ');
 77 // "!", "Exclamation", "U+0021"
 78 keyIdentifierList.set("Exclamation", '!');
 79 // "DoubleQuote", "U+0022"
 80 keyIdentifierList.set("DoubleQuote", '"');
 81 // "#", "Hash", "U+0023"
 82 keyIdentifierList.set("Hash", '#');
 83 // "$", "Dollar", "U+0024"
 84 keyIdentifierList.set("Dollar", '$');
 85 // "&", "Ampersand", "U+0026"
 86 keyIdentifierList.set("Ampersand", '&');
 87 // "Apostrophe", "U+0027"
 88 keyIdentifierList.set("Apostrophe", '\'');
 89 // "(", "LeftParen", "U+0028"
 90 keyIdentifierList.set("LeftParen", '(');
 91 // ")", "RightParen", "U+0029"
 92 keyIdentifierList.set("RightParen", ')');
 93 // "*", "Asterisk", "U+002A"
 94 keyIdentifierList.set("Asterisk", '*');
 95 // "+", "Plus", "U+002B"
 96 keyIdentifierList.set("Plus", '+');
 97 // "%", "Percent", "U+0025"
 98 keyIdentifierList.set("Percent", '%');
 99 // ",", "Comma", "U+002C"
 100 keyIdentifierList.set("Comma", ',');
 101 // "-", "HyphenMinus", "U+002D"
 102 keyIdentifierList.set("HypenMinus", '-');
 103 // ".", "Period", "U+002E"
 104 keyIdentifierList.set("Period", '.');
 105 // "/", "Solidus", "U+002F"
 106 keyIdentifierList.set("Solidus", '/');
 107 // ":", "Colon", "U+003A"
 108 keyIdentifierList.set("Colon", ':');
 109 // ";", "Semicolon", "U+003B"
 110 keyIdentifierList.set("Semicolon", ';');
 111 // "LessThan", "U+003C"
 112 keyIdentifierList.set("LessThan", '<');
 113 // "=", "Equals", "U+003D"
 114 keyIdentifierList.set("Equals", '=');
 115 // "GreaterThan", "U+003E"
 116 keyIdentifierList.set("GreaterThan", '>');
 117 // "?", "QuestionMark", "U+003F"
 118 keyIdentifierList.set("QuestionMark", '?');
 119 // "@", "At", "U+0040"
 120 keyIdentifierList.set("At", '@');
 121 // "[", "LeftSquareBracket", "U+005B"
 122 keyIdentifierList.set("LeftSquareBracket", '[');
 123 // "\\", "Backslash", "U+005C"
 124 keyIdentifierList.set("Backslash", '\\');
 125 // "]", "RightSquareBracket", "U+005D"
 126 keyIdentifierList.set("RightSquareBracket", ']');
 127 // "^", "Circumflex", "U+005E"
 128 keyIdentifierList.set("Circumflex", '^');
 129 // "_", "Underscore", "U+005F"
 130 keyIdentifierList.set("Underscore", '_');
 131 // "`", "Grave", "U+0060"
 132 keyIdentifierList.set("Grave", '`');
 133 // "{", "LeftCurlyBracket", "U+007B"
 134 keyIdentifierList.set("LeftCurlyBracket", '{');
 135 // "|", "Pipe", "U+007C"
 136 keyIdentifierList.set("Pipe", '|');
 137 // "}", "RightCurlyBracket", "U+007D"
 138 keyIdentifierList.set("RightCurlyBracket", '}');
 139 // "Del", "U+007F"
 140 keyIdentifierList.set("Del", 0x007F);
 141 // "", "InvertedExclamation", "U+00A1"
 142 keyIdentifierList.set("InvertedExclamation", 0x00A1);
 143 // "DeadGrave", "U+0300"
 144 keyIdentifierList.set("DeadGrave", 0x0300);
 145 // "DeadEacute", "U+0301"
 146 keyIdentifierList.set("DeadEacute", 0x0301);
 147 // "DeadCircumflex", "U+0302"
 148 keyIdentifierList.set("DeadCircumflex", 0x0302);
 149 // "DeadTilde", "U+0303"
 150 keyIdentifierList.set("DeadTilde", 0x0303);
 151 // "DeadMacron", "U+0304"
 152 keyIdentifierList.set("DeadMacron", 0x0304);
 153 // "DeadBreve", "U+0306"
 154 keyIdentifierList.set("DeadBreve", 0x0306);
 155 // "DeadAboveDot", "U+0307"
 156 keyIdentifierList.set("DeadAboveDot", 0x0307);
 157 // "DeadUmlaut", "U+0308"
 158 keyIdentifierList.set("DeadUmlaut", 0x0308);
 159 // "DeadAboveRing", "U+030A"
 160 keyIdentifierList.set("DeadAboveRing", 0x030A);
 161 // "DeadDoubleacute", "U+030B"
 162 keyIdentifierList.set("DeadDoubleacute", 0x030B);
 163 // "DeadCaron", "U+030C"
 164 keyIdentifierList.set("DeadCaron", 0x030C);
 165 // "DeadCedilla", "U+0327"
 166 keyIdentifierList.set("DeadCedilla", 0x0327);
 167 // "DeadOgonek", "U+0328"
 168 keyIdentifierList.set("DeadOgonek", 0x0328);
 169 // "DeadIota", "U+0345"
 170 keyIdentifierList.set("DeadIota", 0x0345);
 171 // "", "Euro", "U+20AC"
 172 keyIdentifierList.set("Euro", 0x20AC);
 173 // "DeadVoicedSound", "U+3099"
 174 keyIdentifierList.set("DeadVoicedSound", 0x3099);
 175 // "DeadSemivoicedSound", "U+309A"
 176 keyIdentifierList.set("DeadSemivoicedSound", 0x309A);
 177 }
 178 return &keyIdentifierList;
 179}
 180
 181static bool isValidCharCode(int c)
 182{
 183 if (c >= ' ' && c <= 127 || c == '\b' || c == '\t' || c == '\r' || c == 24 /* Cancel */ || c == 27 /* Esc */
 184 || c == 0x00A1 /* InvertedExclamation */ || c >= 0x0300 /* DeadGrave */ && c <= 0x0308 /* DeadUmlaut */
 185 || c == 0x030A /* DeadAboveRing */ || c == 0x030B /* DeadDoubleacute */ || c == 0x030C /* DeadCaron */
 186 || c == 0x0327 /* DeadCedilla */ || c == 0x0328 /* DeadOgonek */ || c == 0x0345 /* DeadIota */
 187 || c == 0x20AC /* Euro */ || c == 0x3099 /* DeadVoicedSound */ || c == 0x309A /* DeadSemivoicedSound */)
 188 return true;
 189 return false;
 190}
 191
 192static unsigned charCodeForKeyIdentifier(const String& keyIdentifier)
 193{
 194 ASSERT(keyIdentifierList());
 195 if (keyIdentifier.isEmpty())
 196 return 0;
 197
 198 // Note, this ordering was explicitly chosen so that the platform can override the defaults.
 199 HashMap<String, unsigned>* platformKeyIdentifierList = PlatformKeyboardEvent::keyIdentifierList();
 200 if (!platformKeyIdentifierList)
 201 return 0;
 202 HashMap<String, unsigned>::iterator it = platformKeyIdentifierList->find(keyIdentifier);
 203 if (it != platformKeyIdentifierList->end())
 204 return it->second;
 205
 206 it = keyIdentifierList()->find(keyIdentifier);
 207 if (it != keyIdentifierList()->end())
 208 return it->second;
 209
 210 int firstChar = keyIdentifier.characterStartingAt(0);
 211 if (keyIdentifier.length() == 1 && isASCIIPrintable(firstChar))
 212 return static_cast<unsigned>(firstChar);
 213 if (keyIdentifier.length() == 1)
 214 return 0; // Non-printable ASCII character.
 215
 216 if (keyIdentifier.length() == (2 /* "U+" */ + numUnicodeCodePointHexDigits) && keyIdentifier.substring(0, 2) == "U+") {
 217 const UChar* p = keyIdentifier.characters();
 218 p += 2; // Skip over "U+", so that we point to the first hex digit.
 219 unsigned unicodeValue = 0;
 220 unsigned numHexDigits = numUnicodeCodePointHexDigits;
 221 while (numHexDigits--)
 222 unicodeValue = unicodeValue << 4 | toASCIIHexValue(*(p++));
 223 return isValidCharCode(unicodeValue)? unicodeValue : 0;
 224 }
 225
 226 return 0;
 227}
 228
 229static unsigned keyCodeForKeyIdentifier(const String&)
 230{
 231 return 0;
 232}
 233
53234KeyboardEvent::KeyboardEvent()
54235 : m_keyEvent(0)
55236 , m_keyLocation(DOM_KEY_LOCATION_STANDARD)

@@int KeyboardEvent::keyCode() const
119300 // IE: virtual key code for keyup/keydown, character code for keypress
120301 // Firefox: virtual key code for keyup/keydown, zero for keypress
121302 // We match IE.
122  if (!m_keyEvent)
123  return 0;
124303 if (type() == eventNames().keydownEvent || type() == eventNames().keyupEvent)
125  return m_keyEvent->windowsVirtualKeyCode();
 304 return m_keyEvent? m_keyEvent->windowsVirtualKeyCode() : keyCodeForKeyIdentifier(m_keyIdentifier);
126305 return charCode();
127306}
128307

@@int KeyboardEvent::charCode() const
135314 if (view())
136315 backwardCompatibilityMode = view()->frame()->eventHandler()->needsKeyboardEventDisambiguationQuirks();
137316
138  if (!m_keyEvent || (type() != eventNames().keypressEvent && !backwardCompatibilityMode))
 317 if (type() != eventNames().keypressEvent && !backwardCompatibilityMode)
139318 return 0;
140  String text = m_keyEvent->text();
141  return static_cast<int>(text.characterStartingAt(0));
 319 return m_keyEvent? static_cast<int>(m_keyEvent->text().characterStartingAt(0)) : charCodeForKeyIdentifier(m_keyIdentifier);
142320}
143321
144322bool KeyboardEvent::isKeyboardEvent() const
50865

WebCore/platform/PlatformKeyboardEvent.h

@@namespace WebCore {
129129
130130 static bool currentCapsLockState();
131131
 132 static HashMap<String, unsigned>* keyIdentifierList();
 133
132134#if PLATFORM(MAC)
133135 PlatformKeyboardEvent(NSEvent*);
134136 NSEvent* macEvent() const { return m_macEvent.get(); }
50865

WebCore/platform/android/KeyEventAndroid.cpp

3333
3434#include "KeyboardCodes.h"
3535#include "NotImplemented.h"
 36#include "StringHash.h"
3637#include <ui/KeycodeLabels.h>
 38#include <wtf/HashMap.h>
3739
3840namespace WebCore {
3941

@@void PlatformKeyboardEvent::disambiguate
270272 }
271273}
272274
 275HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 276{
 277 typedef HashMap<String, unsigned> KeyIdentifierMap;
 278 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 279 if (keyIdentifierList.isEmpty()) {
 280 // "Accept"
 281 // "Add"
 282 // "Again"
 283 // "AllCandidates"
 284 // "Alphanumeric"
 285 // "Alt"
 286 // "AltGraph"
 287 // "Apps"
 288 // "Attn"
 289 // "BrowserBack"
 290 // "BrowserFavorites"
 291 // "BrowserForward"
 292 // "BrowserHome"
 293 // "BrowserRefresh"
 294 // "BrowserSearch"
 295 // "BrowserStop"
 296 // "CapsLock"
 297 // "Clear"
 298 keyIdentifierList.set("Clear", kKeyCodeClear);
 299 // "CodeInput"
 300 // "Compose"
 301 // "Control"
 302 // "Crsel"
 303 // "Convert"
 304 // "Copy"
 305 // "Cut"
 306 // "Decimal"
 307 // "Divide"
 308 // "Down"
 309 keyIdentifierList.set("Down", kKeyCodeDpadDown);
 310 // "DownLeft"
 311 // "DownRight"
 312 // "End"
 313 // "Enter"
 314 keyIdentifierList.set("Enter", kKeyCodeDpadCenter);
 315 // "EraseEof"
 316 // "Execute"
 317 // "Exsel"
 318 // "Fn"
 319 // "F1"
 320 // "F2"
 321 // "F3"
 322 // "F4"
 323 // "F5"
 324 // "F6"
 325 // "F7"
 326 // "F8"
 327 // "F9"
 328 // "F10"
 329 // "F11"
 330 // "F12"
 331 // "F13"
 332 // "F14"
 333 // "F15"
 334 // "F16"
 335 // "F17"
 336 // "F18"
 337 // "F19"
 338 // "F20"
 339 // "F21"
 340 // "F22"
 341 // "F23"
 342 // "F24"
 343 // "FinalMode"
 344 // "Find"
 345 // "FullWidth"
 346 // "HalfWidth"
 347 // "HangulMode"
 348 // "HanjaMode"
 349 // "Help"
 350 // "Hiragana"
 351 // "Home"
 352 keyIdentifierList.set("Home", kKeyCodeHome);
 353 // "Insert"
 354 // "JapaneseHiragana"
 355 // "JapaneseKatakana"
 356 // "JapaneseRomaji"
 357 // "JunjaMode"
 358 // "KanaMode"
 359 // "KanjiMode"
 360 // "Katakana"
 361 // "LaunchApplication1"
 362 // "LaunchApplication2"
 363 // "LaunchMail"
 364 // "Left"
 365 keyIdentifierList.set("Left", kKeyCodeDpadLeft);
 366 // "Menu"
 367 // "Meta"
 368 // "MediaNextTrack"
 369 // "MediaPlayPause"
 370 // "MediaPreviousTrack"
 371 // "MediaStop"
 372 // "ModeChange"
 373 // "Multiply"
 374 // "NextCandidate"
 375 // "Nonconvert"
 376 // "NumLock"
 377 // "PageDown"
 378 // "PageUp"
 379 // "Paste"
 380 // "Pause"
 381 // "Play"
 382 // "PreviousCandidate"
 383 // "PrintScreen"
 384 // "Process"
 385 // "Props"
 386 // "Right"
 387 keyIdentifierList.set("Right", kKeyCodeDpadRight);
 388 // "RomanCharacters"
 389 // "Scroll"
 390 // "Select"
 391 // "SelectMedia"
 392 // "Separator"
 393 // "Shift"
 394 // "Soft1"
 395 // "Soft2"
 396 // "Soft3"
 397 // "Soft4"
 398 // "Stop"
 399 // "Subtract"
 400 // "Up"
 401 keyIdentifierList.set("Up", kKeyCodeDpadUp);
 402 // "UpLeft"
 403 // "UpRight"
 404 // "Undo"
 405 // "VolumeDown"
 406 // "VolumeMute"
 407 // "VolumeUp"
 408 // "Win"
 409 // "Zoom"
 410 // "0"
 411 keyIdentifierList.set("0", kKeyCode0);
 412 // "1"
 413 keyIdentifierList.set("1", kKeyCode1);
 414 // "2"
 415 keyIdentifierList.set("2", kKeyCode2);
 416 // "3"
 417 keyIdentifierList.set("3", kKeyCode3);
 418 // "4"
 419 keyIdentifierList.set("4", kKeyCode4);
 420 // "5"
 421 keyIdentifierList.set("5", kKeyCode5);
 422 // "6"
 423 keyIdentifierList.set("6", kKeyCode6);
 424 // "7"
 425 keyIdentifierList.set("7", kKeyCode7);
 426 // "8"
 427 keyIdentifierList.set("8", kKeyCode8);
 428 // "9"
 429 keyIdentifierList.set("9", kKeyCode9);
 430 // "A"
 431 keyIdentifierList.set("A", kKeyCodeA);
 432 // "B"
 433 keyIdentifierList.set("B", kKeyCodeB);
 434 // "C"
 435 keyIdentifierList.set("C", kKeyCodeC);
 436 // "D"
 437 keyIdentifierList.set("D", kKeyCodeD);
 438 // "E"
 439 keyIdentifierList.set("E", kKeyCodeE);
 440 // "F"
 441 keyIdentifierList.set("F", kKeyCodeF);
 442 // "G"
 443 keyIdentifierList.set("G", kKeyCodeG);
 444 // "H"
 445 keyIdentifierList.set("H", kKeyCodeH);
 446 // "I"
 447 keyIdentifierList.set("I", kKeyCodeI);
 448 // "J"
 449 keyIdentifierList.set("J", kKeyCodeJ);
 450 // "K"
 451 keyIdentifierList.set("K", kKeyCodeK);
 452 // "L"
 453 keyIdentifierList.set("L", kKeyCodeL);
 454 // "M"
 455 keyIdentifierList.set("M", kKeyCodeM);
 456 // "N"
 457 keyIdentifierList.set("N", kKeyCodeN);
 458 // "O"
 459 keyIdentifierList.set("O", kKeyCodeO);
 460 // "P"
 461 keyIdentifierList.set("P", kKeyCodeP);
 462 // "Q"
 463 keyIdentifierList.set("Q", kKeyCodeQ);
 464 // "R"
 465 keyIdentifierList.set("R", kKeyCodeR);
 466 // "S"
 467 keyIdentifierList.set("S", kKeyCodeS);
 468 // "T"
 469 keyIdentifierList.set("T", kKeyCodeT);
 470 // "U"
 471 keyIdentifierList.set("U", kKeyCodeU);
 472 // "V"
 473 keyIdentifierList.set("V", kKeyCodeV);
 474 // "W"
 475 keyIdentifierList.set("W", kKeyCodeW);
 476 // "X"
 477 keyIdentifierList.set("X", kKeyCodeX);
 478 // "Y"
 479 keyIdentifierList.set("Y", kKeyCodeY);
 480 // "Z"
 481 keyIdentifierList.set("Z", kKeyCodeZ);
 482 }
 483 return &keyIdentifierList;
 484}
 485
273486} // namespace WebCore
50865

WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp

2727#include "config.h"
2828#include "PlatformKeyboardEvent.h"
2929
 30#include "StringHash.h"
 31#include <wtf/HashMap.h>
 32
3033#if PLATFORM(WIN_OS)
3134#include <windows.h>
3235#elif PLATFORM(DARWIN)

@@bool PlatformKeyboardEvent::currentCapsL
8285#endif
8386}
8487
 88static HashMap<String, unsigned>* keyIdentifierList()
 89{
 90 // FIXME: This method needs to be a combination of KeyEventMac.mm and KeyEventWin.cpp.
 91 return 0;
 92}
 93
8594} // namespace WebCore
50865

WebCore/platform/gtk/KeyEventGtk.cpp

3232
3333#include "KeyboardCodes.h"
3434#include "NotImplemented.h"
 35#include "StringHash.h"
3536#include "TextEncoding.h"
 37#include <wtf/HashMap.h>
3638
3739#include <gdk/gdk.h>
3840#include <gdk/gdkkeysyms.h>

@@GdkEventKey* PlatformKeyboardEvent::gdkE
574576 return m_gdkEventKey;
575577}
576578
 579HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 580{
 581 typedef HashMap<String, unsigned> KeyIdentifierMap;
 582 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 583 if (keyIdentifierList.isEmpty()) {
 584 // "Accept"
 585 // "Add"
 586 // "Again"
 587 // "AllCandidates"
 588 // "Alphanumeric"
 589 // "Alt"
 590 keyIdentifierList.set("Alt", GDK_Alt_L);
 591 // "AltGraph"
 592 // "Apps"
 593 // "Attn"
 594 // "BrowserBack"
 595 // "BrowserFavorites"
 596 // "BrowserForward"
 597 // "BrowserHome"
 598 // "BrowserRefresh"
 599 // "BrowserSearch"
 600 // "BrowserStop"
 601 // "CapsLock"
 602 // "Clear"
 603 keyIdentifierList.set("Clear", GDK_Clear);
 604 // "CodeInput"
 605 // "Compose"
 606 // "Control"
 607 // "Crsel"
 608 // "Convert"
 609 // "Copy"
 610 // "Cut"
 611 // "Decimal"
 612 // "Divide"
 613 // "Down"
 614 keyIdentifierList.set("Down", GDK_Down);
 615 // "DownLeft"
 616 // "DownRight"
 617 // "End"
 618 keyIdentifierList.set("End", GDK_End);
 619 // "Enter"
 620 keyIdentifierList.set("Enter", GDK_Return);
 621 // "EraseEof"
 622 // "Execute"
 623 keyIdentifierList.set("Execute", GDK_Execute);
 624 // "Exsel"
 625 // "Fn"
 626 // "F1"
 627 keyIdentifierList.set("F1", GDK_F1);
 628 // "F2"
 629 keyIdentifierList.set("F2", GDK_F2);
 630 // "F3"
 631 keyIdentifierList.set("F3", GDK_F3);
 632 // "F4"
 633 keyIdentifierList.set("F4", GDK_F4);
 634 // "F5"
 635 keyIdentifierList.set("F5", GDK_F5);
 636 // "F6"
 637 keyIdentifierList.set("F6", GDK_F6);
 638 // "F7"
 639 keyIdentifierList.set("F7", GDK_F7);
 640 // "F8"
 641 keyIdentifierList.set("F8", GDK_F8);
 642 // "F9"
 643 keyIdentifierList.set("F9", GDK_F9);
 644 // "F10"
 645 keyIdentifierList.set("F10", GDK_F10);
 646 // "F11"
 647 keyIdentifierList.set("F11", GDK_F11);
 648 // "F12"
 649 keyIdentifierList.set("F12", GDK_F12);
 650 // "F13"
 651 keyIdentifierList.set("F13", GDK_F13);
 652 // "F14"
 653 keyIdentifierList.set("F14", GDK_F14);
 654 // "F15"
 655 keyIdentifierList.set("F15", GDK_F15);
 656 // "F16"
 657 keyIdentifierList.set("F16", GDK_F16);
 658 // "F17"
 659 keyIdentifierList.set("F17", GDK_F17);
 660 // "F18"
 661 keyIdentifierList.set("F18", GDK_F18);
 662 // "F19"
 663 keyIdentifierList.set("F19", GDK_F19);
 664 // "F20"
 665 keyIdentifierList.set("F20", GDK_F20);
 666 // "F21"
 667 keyIdentifierList.set("F21", GDK_F21);
 668 // "F22"
 669 keyIdentifierList.set("F22", GDK_F22);
 670 // "F23"
 671 keyIdentifierList.set("F23", GDK_F23);
 672 // "F24"
 673 keyIdentifierList.set("F24", GDK_F24);
 674 // "FinalMode"
 675 // "Find"
 676 // "FullWidth"
 677 // "HalfWidth"
 678 // "HangulMode"
 679 // "HanjaMode"
 680 // "Help"
 681 keyIdentifierList.set("Help", GDK_Help);
 682 // "Hiragana"
 683 // "Home"
 684 keyIdentifierList.set("Home", GDK_Home);
 685 // "Insert"
 686 keyIdentifierList.set("Insert", GDK_Insert);
 687 // "JapaneseHiragana"
 688 // "JapaneseKatakana"
 689 // "JapaneseRomaji"
 690 // "JunjaMode"
 691 // "KanaMode"
 692 // "KanjiMode"
 693 // "Katakana"
 694 // "LaunchApplication1"
 695 // "LaunchApplication2"
 696 // "LaunchMail"
 697 // "Left"
 698 keyIdentifierList.set("Left", GDK_Left);
 699 // "Menu"
 700 // "Meta"
 701 // "MediaNextTrack"
 702 // "MediaPlayPause"
 703 // "MediaPreviousTrack"
 704 // "MediaStop"
 705 // "ModeChange"
 706 // "Multiply"
 707 // "NextCandidate"
 708 // "Nonconvert"
 709 // "NumLock"
 710 // "PageDown"
 711 keyIdentifierList.set("PageDown", GDK_Page_Down);
 712 // "PageUp"
 713 keyIdentifierList.set("PageUp", GDK_Page_Up);
 714 // "Paste"
 715 // "Pause"
 716 keyIdentifierList.set("Pause", GDK_Pause);
 717 // "Play"
 718 // "PreviousCandidate"
 719 // "PrintScreen"
 720 keyIdentifierList.set("PrintScreen", GDK_3270_PrintScreen);
 721 // "Process"
 722 // "Props"
 723 // "Right"
 724 keyIdentifierList.set("Right", GDK_Right);
 725 // "RomanCharacters"
 726 // "Scroll"
 727 // "Select"
 728 keyIdentifierList.set("Select", GDK_Select);
 729 // "SelectMedia"
 730 // "Separator"
 731 // "Shift"
 732 // "Soft1"
 733 // "Soft2"
 734 // "Soft3"
 735 // "Soft4"
 736 // "Stop"
 737 // "Subtract"
 738 // "Up"
 739 keyIdentifierList.set("Up", GDK_Up);
 740 // "UpLeft"
 741 // "UpRight"
 742 // "Undo"
 743 // "VolumeDown"
 744 // "VolumeMute"
 745 // "VolumeUp"
 746 // "Win"
 747 // "Zoom"
 748 }
 749 return &keyIdentifierList;
 750}
 751
577752}
50865

WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp

3434#include <InterfaceDefs.h>
3535#include <Message.h>
3636#include <String.h>
 37#include "StringHash.h"
 38#include <wtf/HashMap.h>
3739
3840
3941namespace WebCore {

@@bool PlatformKeyboardEvent::currentCapsL
189191 return false;
190192}
191193
 194HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 195{
 196 typedef HashMap<String, unsigned> KeyIdentifierMap;
 197 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 198 if (keyIdentifierList.isEmpty()) {
 199 // "Accept"
 200 // "Add"
 201 // "Again"
 202 // "AllCandidates"
 203 // "Alphanumeric"
 204 // "Alt"
 205 // "AltGraph"
 206 // "Apps"
 207 // "Attn"
 208 // "BrowserBack"
 209 // "BrowserFavorites"
 210 // "BrowserForward"
 211 // "BrowserHome"
 212 // "BrowserRefresh"
 213 // "BrowserSearch"
 214 // "BrowserStop"
 215 // "CapsLock"
 216 // "Clear"
 217 // "CodeInput"
 218 // "Compose"
 219 // "Control"
 220 // "Crsel"
 221 // "Convert"
 222 // "Copy"
 223 // "Cut"
 224 // "Decimal"
 225 // "Divide"
 226 // "Down"
 227 keyIdentifierList.set("Down", B_DOWN_ARROW);
 228 // "DownLeft"
 229 // "DownRight"
 230 // "End"
 231 keyIdentifierList.set("End", B_END);
 232 // "Enter"
 233 keyIdentifierList.set("Enter", B_ENTER);
 234 // "EraseEof"
 235 // "Execute"
 236 // "Exsel"
 237 // "Fn"
 238 // "F1"
 239 keyIdentifierList.set("F1", B_F1_KEY);
 240 // "F2"
 241 keyIdentifierList.set("F2", B_F2_KEY);
 242 // "F3"
 243 keyIdentifierList.set("F3", B_F3_KEY);
 244 // "F4"
 245 keyIdentifierList.set("F4", B_F4_KEY);
 246 // "F5"
 247 keyIdentifierList.set("F5", B_F5_KEY);
 248 // "F6"
 249 keyIdentifierList.set("F6", B_F6_KEY);
 250 // "F7"
 251 keyIdentifierList.set("F7", B_F7_KEY);
 252 // "F8"
 253 keyIdentifierList.set("F8", B_F8_KEY);
 254 // "F9"
 255 keyIdentifierList.set("F9", B_F9_KEY);
 256 // "F10"
 257 keyIdentifierList.set("F10", B_F10_KEY);
 258 // "F11"
 259 keyIdentifierList.set("F11", B_F11_KEY);
 260 // "F12"
 261 keyIdentifierList.set("F12", B_F12_KEY);
 262 // "F13"
 263 // "F14"
 264 // "F15"
 265 // "F16"
 266 // "F17"
 267 // "F18"
 268 // "F19"
 269 // "F20"
 270 // "F21"
 271 // "F22"
 272 // "F23"
 273 // "F24"
 274 // "FinalMode"
 275 // "Find"
 276 // "FullWidth"
 277 // "HalfWidth"
 278 // "HangulMode"
 279 // "HanjaMode"
 280 // "Help"
 281 // "Hiragana"
 282 // "Home"
 283 keyIdentifierList.set("Home", B_HOME);
 284 // "Insert"
 285 keyIdentifierList.set("Insert", B_INSERT);
 286 // "JapaneseHiragana"
 287 // "JapaneseKatakana"
 288 // "JapaneseRomaji"
 289 // "JunjaMode"
 290 // "KanaMode"
 291 // "KanjiMode"
 292 // "Katakana"
 293 // "LaunchApplication1"
 294 // "LaunchApplication2"
 295 // "LaunchMail"
 296 // "Left"
 297 keyIdentifierList.set("Left", B_LEFT_ARROW);
 298 // "Menu"
 299 // "Meta"
 300 // "MediaNextTrack"
 301 // "MediaPlayPause"
 302 // "MediaPreviousTrack"
 303 // "MediaStop"
 304 // "ModeChange"
 305 // "Multiply"
 306 // "NextCandidate"
 307 // "Nonconvert"
 308 // "NumLock"
 309 // "PageDown"
 310 keyIdentifierList.set("PageDown", B_PAGE_DOWN);
 311 // "PageUp"
 312 keyIdentifierList.set("PageUp", B_PAGE_UP);
 313 // "Paste"
 314 // "Pause"
 315 keyIdentifierList.set("Pause", B_PAUSE_KEY);
 316 // "Play"
 317 // "PreviousCandidate"
 318 // "PrintScreen"
 319 keyIdentifierList.set("PrintScreen", B_PRINT_KEY);
 320 // "Process"
 321 // "Props"
 322 // "Right"
 323 keyIdentifierList.set("Right", B_RIGHT_ARROW);
 324 // "RomanCharacters"
 325 // "Scroll"
 326 keyIdentifierList.set("Scroll", B_SCROLL_KEY);
 327 // "Select"
 328 // "SelectMedia"
 329 // "Separator"
 330 // "Shift"
 331 // "Soft1"
 332 // "Soft2"
 333 // "Soft3"
 334 // "Soft4"
 335 // "Stop"
 336 // "Subtract"
 337 // "Up"
 338 keyIdentifierList.set("Up", B_UP_ARROW);
 339 // "UpLeft"
 340 // "UpRight"
 341 // "Undo"
 342 // "VolumeDown"
 343 // "VolumeMute"
 344 // "VolumeUp"
 345 // "Win"
 346 // "Zoom"
 347 }
 348 return &keyIdentifierList;
 349}
 350
192351} // namespace WebCore
193352
50865

WebCore/platform/mac/KeyEventMac.mm

2727#import "PlatformKeyboardEvent.h"
2828
2929#import "Logging.h"
 30#import "StringHash.h"
3031#import <Carbon/Carbon.h>
3132#import <wtf/ASCIICType.h>
 33#import <wtf/HashMap.h>
3234
3335using namespace WTF;
3436

@@bool PlatformKeyboardEvent::currentCapsL
873875 return GetCurrentKeyModifiers() & alphaLock;
874876}
875877
 878HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 879{
 880 typedef HashMap<String, unsigned> KeyIdentifierMap;
 881 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 882 if (keyIdentifierList.isEmpty()) {
 883 // "Accept"
 884 // "Add"
 885 // "Again"
 886 // "AllCandidates"
 887 // "Alphanumeric"
 888 // "Alt"
 889 keyIdentifierList.set("Alt", NSMenuFunctionKey);
 890 // "AltGraph"
 891 // "Apps"
 892 // "Attn"
 893 // "BrowserBack"
 894 // "BrowserFavorites"
 895 // "BrowserForward"
 896 // "BrowserHome"
 897 // "BrowserRefresh"
 898 // "BrowserSearch"
 899 // "BrowserStop"
 900 // "CapsLock"
 901 // "Clear"
 902 keyIdentifierList.set("Clear", NSClearLineFunctionKey);
 903 // "CodeInput"
 904 // "Compose"
 905 // "Control"
 906 // "Crsel"
 907 // "Convert"
 908 // "Copy"
 909 // "Cut"
 910 // "Decimal"
 911 // "Divide"
 912 // "Down"
 913 keyIdentifierList.set("Down", NSDownArrowFunctionKey);
 914 // "DownLeft"
 915 // "DownRight"
 916 // "End"
 917 keyIdentifierList.set("End", NSEndFunctionKey);
 918 // "Enter"
 919 keyIdentifierList.set("Enter", '\r');
 920 // "EraseEof"
 921 // "Execute"
 922 keyIdentifierList.set("Execute", NSExecuteFunctionKey);
 923 // "Exsel"
 924 // "Fn"
 925 // "F1"
 926 keyIdentifierList.set("F1", NSF1FunctionKey);
 927 // "F2"
 928 keyIdentifierList.set("F2", NSF2FunctionKey);
 929 // "F3"
 930 keyIdentifierList.set("F3", NSF3FunctionKey);
 931 // "F4"
 932 keyIdentifierList.set("F4", NSF4FunctionKey);
 933 // "F5"
 934 keyIdentifierList.set("F5", NSF5FunctionKey);
 935 // "F6"
 936 keyIdentifierList.set("F6", NSF6FunctionKey);
 937 // "F7"
 938 keyIdentifierList.set("F7", NSF7FunctionKey);
 939 // "F8"
 940 keyIdentifierList.set("F8", NSF8FunctionKey);
 941 // "F9"
 942 keyIdentifierList.set("F9", NSF9FunctionKey);
 943 // "F10"
 944 keyIdentifierList.set("F10", NSF10FunctionKey);
 945 // "F11"
 946 keyIdentifierList.set("F11", NSF11FunctionKey);
 947 // "F12"
 948 keyIdentifierList.set("F12", NSF12FunctionKey);
 949 // "F13"
 950 keyIdentifierList.set("F13", NSF13FunctionKey);
 951 // "F14"
 952 keyIdentifierList.set("F14", NSF14FunctionKey);
 953 // "F15"
 954 keyIdentifierList.set("F15", NSF15FunctionKey);
 955 // "F16"
 956 keyIdentifierList.set("F16", NSF16FunctionKey);
 957 // "F17"
 958 keyIdentifierList.set("F17", NSF17FunctionKey);
 959 // "F18"
 960 keyIdentifierList.set("F18", NSF18FunctionKey);
 961 // "F19"
 962 keyIdentifierList.set("F19", NSF19FunctionKey);
 963 // "F20"
 964 keyIdentifierList.set("F20", NSF20FunctionKey);
 965 // "F21"
 966 keyIdentifierList.set("F21", NSF21FunctionKey);
 967 // "F22"
 968 keyIdentifierList.set("F22", NSF22FunctionKey);
 969 // "F23"
 970 keyIdentifierList.set("F23", NSF23FunctionKey);
 971 // "F24"
 972 keyIdentifierList.set("F24", NSF24FunctionKey);
 973 // "FinalMode"
 974 // "Find"
 975 keyIdentifierList.set("Find", NSFindFunctionKey);
 976 // "FullWidth"
 977 // "HalfWidth"
 978 // "HangulMode"
 979 // "HanjaMode"
 980 // "Help"
 981 keyIdentifierList.set("Help", NSHelpFunctionKey);
 982 // "Hiragana"
 983 // "Home"
 984 keyIdentifierList.set("Home", NSHomeFunctionKey);
 985 // "Insert"
 986 keyIdentifierList.set("Insert", NSInsertFunctionKey);
 987 // "JapaneseHiragana"
 988 // "JapaneseKatakana"
 989 // "JapaneseRomaji"
 990 // "JunjaMode"
 991 // "KanaMode"
 992 // "KanjiMode"
 993 // "Katakana"
 994 // "LaunchApplication1"
 995 // "LaunchApplication2"
 996 // "LaunchMail"
 997 // "Left"
 998 keyIdentifierList.set("Left", NSLeftArrowFunctionKey);
 999 // "Menu"
 1000 // "Meta"
 1001 // "MediaNextTrack"
 1002 // "MediaPlayPause"
 1003 // "MediaPreviousTrack"
 1004 // "MediaStop"
 1005 // "ModeChange"
 1006 keyIdentifierList.set("ModeChange", NSModeSwitchFunctionKey);
 1007 // "Multiply"
 1008 // "NextCandidate"
 1009 // "Nonconvert"
 1010 // "NumLock"
 1011 // "PageDown"
 1012 keyIdentifierList.set("PageDown", NSPageDownFunctionKey);
 1013 // "PageUp"
 1014 keyIdentifierList.set("PageUp", NSPageUpFunctionKey);
 1015 // "Paste"
 1016 // "Pause"
 1017 keyIdentifierList.set("Pause", NSPauseFunctionKey);
 1018 // "Play"
 1019 // "PreviousCandidate"
 1020 // "PrintScreen"
 1021 keyIdentifierList.set("PrintScreen", NSPrintScreenFunctionKey);
 1022 // "Process"
 1023 // "Props"
 1024 // "Right"
 1025 keyIdentifierList.set("Right", NSRightArrowFunctionKey);
 1026 // "RomanCharacters"
 1027 // "Scroll"
 1028 keyIdentifierList.set("Scroll", NSScrollLockFunctionKey);
 1029 // "Select"
 1030 keyIdentifierList.set("Select", NSSelectFunctionKey);
 1031 // "SelectMedia"
 1032 // "Separator"
 1033 // "Shift"
 1034 // "Soft1"
 1035 // "Soft2"
 1036 // "Soft3"
 1037 // "Soft4"
 1038 // "Stop"
 1039 keyIdentifierList.set("Stop", NSStopFunctionKey);
 1040 // "Subtract"
 1041 // "Up"
 1042 keyIdentifierList.set("Up", NSUpArrowFunctionKey);
 1043 // "UpLeft"
 1044 // "UpRight"
 1045 // "Undo"
 1046 keyIdentifierList.set("Undo", NSUndoFunctionKey);
 1047 // "VolumeDown"
 1048 // "VolumeMute"
 1049 // "VolumeUp"
 1050 // "Win"
 1051 // "Zoom"
 1052 }
 1053 return &keyIdentifierList;
 1054}
 1055
8761056}
50865

WebCore/platform/qt/PlatformKeyboardEventQt.cpp

3030
3131#include "KeyboardCodes.h"
3232#include "NotImplemented.h"
 33#include "StringHash.h"
 34#include <wtf/HashMap.h>
3335
3436#include <ctype.h>
3537

@@bool PlatformKeyboardEvent::currentCapsL
537539 return false;
538540}
539541
 542HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 543{
 544 typedef HashMap<String, unsigned> KeyIdentifierMap;
 545 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 546 if (keyIdentifierList.isEmpty()) {
 547 // "Accept"
 548 // "Add"
 549 // "Again"
 550 // "AllCandidates"
 551 // "Alphanumeric"
 552 // "Alt"
 553 keyIdentifierList.set("Alt", Qt::Key_Alt);
 554 // "AltGraph"
 555 // "Apps"
 556 // "Attn"
 557 // "BrowserBack"
 558 // "BrowserFavorites"
 559 // "BrowserForward"
 560 // "BrowserHome"
 561 // "BrowserRefresh"
 562 // "BrowserSearch"
 563 // "BrowserStop"
 564 // "CapsLock"
 565 // "Clear"
 566 keyIdentifierList.set("Clear", Qt::Key_Clear);
 567 // "CodeInput"
 568 // "Compose"
 569 // "Control"
 570 // "Crsel"
 571 // "Convert"
 572 // "Copy"
 573 // "Cut"
 574 // "Decimal"
 575 // "Divide"
 576 // "Down"
 577 keyIdentifierList.set("Down", Qt::Key_Down);
 578 // "DownLeft"
 579 // "DownRight"
 580 // "End"
 581 keyIdentifierList.set("End", Qt::Key_End);
 582 // "Enter"
 583 keyIdentifierList.set("Enter", Qt::Key_Enter);
 584 // "EraseEof"
 585#if QT_VERSION >= 0x040200
 586 // "Execute"
 587 keyIdentifierList.set("Execute", Qt::Key_Execute);
 588#endif
 589 // "Exsel"
 590 // "Fn"
 591 // "F1"
 592 keyIdentifierList.set("F1", Qt::Key_F1);
 593 // "F2"
 594 keyIdentifierList.set("F2", Qt::Key_F2);
 595 // "F3"
 596 keyIdentifierList.set("F3", Qt::Key_F3);
 597 // "F4"
 598 keyIdentifierList.set("F4", Qt::Key_F4);
 599 // "F5"
 600 keyIdentifierList.set("F5", Qt::Key_F5);
 601 // "F6"
 602 keyIdentifierList.set("F6", Qt::Key_F6);
 603 // "F7"
 604 keyIdentifierList.set("F7", Qt::Key_F7);
 605 // "F8"
 606 keyIdentifierList.set("F8", Qt::Key_F8);
 607 // "F9"
 608 keyIdentifierList.set("F9", Qt::Key_F9);
 609 // "F10"
 610 keyIdentifierList.set("F10", Qt::Key_F10);
 611 // "F11"
 612 keyIdentifierList.set("F11", Qt::Key_F11);
 613 // "F12"
 614 keyIdentifierList.set("F12", Qt::Key_F12);
 615 // "F13"
 616 keyIdentifierList.set("F13", Qt::Key_F13);
 617 // "F14"
 618 keyIdentifierList.set("F14", Qt::Key_F14);
 619 // "F15"
 620 keyIdentifierList.set("F15", Qt::Key_F15);
 621 // "F16"
 622 keyIdentifierList.set("F16", Qt::Key_F16);
 623 // "F17"
 624 keyIdentifierList.set("F17", Qt::Key_F17);
 625 // "F18"
 626 keyIdentifierList.set("F18", Qt::Key_F18);
 627 // "F19"
 628 keyIdentifierList.set("F19", Qt::Key_F19);
 629 // "F20"
 630 keyIdentifierList.set("F20", Qt::Key_F20);
 631 // "F21"
 632 keyIdentifierList.set("F21", Qt::Key_F21);
 633 // "F22"
 634 keyIdentifierList.set("F22", Qt::Key_F22);
 635 // "F23"
 636 keyIdentifierList.set("F23", Qt::Key_F23);
 637 // "F24"
 638 keyIdentifierList.set("F24", Qt::Key_F24);
 639 // "FinalMode"
 640 // "Find"
 641 // "FullWidth"
 642 // "HalfWidth"
 643 // "HangulMode"
 644 // "HanjaMode"
 645 // "Help"
 646 keyIdentifierList.set("Help", Qt::Key_Help);
 647 // "Hiragana"
 648 // "Home"
 649 keyIdentifierList.set("Home", Qt::Key_Home);
 650 // "Insert"
 651 keyIdentifierList.set("Insert", Qt::Key_Insert);
 652 // "JapaneseHiragana"
 653 // "JapaneseKatakana"
 654 // "JapaneseRomaji"
 655 // "JunjaMode"
 656 // "KanaMode"
 657 // "KanjiMode"
 658 // "Katakana"
 659 // "LaunchApplication1"
 660 // "LaunchApplication2"
 661 // "LaunchMail"
 662 // "Left"
 663 keyIdentifierList.set("Left", Qt::Key_Left);
 664 // "Menu"
 665 // "Meta"
 666 // "MediaNextTrack"
 667 // "MediaPlayPause"
 668 // "MediaPreviousTrack"
 669 // "MediaStop"
 670 // "ModeChange"
 671 // "Multiply"
 672 // "NextCandidate"
 673 // "Nonconvert"
 674 // "NumLock"
 675 // "PageDown"
 676 keyIdentifierList.set("PageDown", Qt::Key_PageDown);
 677 // "PageUp"
 678 keyIdentifierList.set("PageUp", Qt::Key_PageUp);
 679 // "Paste"
 680 // "Pause"
 681 keyIdentifierList.set("Pause", Qt::Key_Pause);
 682 // "Play"
 683 // "PreviousCandidate"
 684 // "PrintScreen"
 685 keyIdentifierList.set("PrintScreen", Qt::Key_Print);
 686 // "Process"
 687 // "Props"
 688 // "Right"
 689 keyIdentifierList.set("Right", Qt::Key_Right);
 690 // "RomanCharacters"
 691 // "Scroll"
 692 // "Select"
 693 keyIdentifierList.set("Select", Qt::Key_Select);
 694 // "SelectMedia"
 695 // "Separator"
 696 // "Shift"
 697 // "Soft1"
 698 // "Soft2"
 699 // "Soft3"
 700 // "Soft4"
 701 // "Stop"
 702 // "Subtract"
 703 // "Up"
 704 keyIdentifierList.set("Up", Qt::Key_Up);
 705 // "UpLeft"
 706 // "UpRight"
 707 // "Undo"
 708 // "VolumeDown"
 709 // "VolumeMute"
 710 // "VolumeUp"
 711 // "Win"
 712 // "Zoom"
 713 }
 714 return &keyIdentifierList;
 715}
 716
540717}
541718
542719// vim: ts=4 sw=4 et
50865

WebCore/platform/wx/KeyEventWin.cpp

2525
2626#include "config.h"
2727#include "PlatformKeyboardEvent.h"
 28
 29#include "StringHash.h"
2830#include <windows.h>
 31#include <wtf/HashMap.h>
2932
3033#define REPEAT_COUNT_MASK 0x0000FFFF
3134#define NEW_RELEASE_STATE_MASK 0x80000000

@@PlatformKeyboardEvent::PlatformKeyboardE
154157 m_text = String(singleCharacterString(tolower(wParam)));
155158}
156159
 160HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 161{
 162 typedef HashMap<String, unsigned> KeyIdentifierMap;
 163 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 164 if (keyIdentifierList.isEmpty()) {
 165 // "Accept"
 166 // "Add"
 167 // "Again"
 168 // "AllCandidates"
 169 // "Alphanumeric"
 170 // "Alt"
 171 keyIdentifierList.set("Alt", VK_MENU);
 172 // "AltGraph"
 173 // "Apps"
 174 // "Attn"
 175 // "BrowserBack"
 176 // "BrowserFavorites"
 177 // "BrowserForward"
 178 // "BrowserHome"
 179 // "BrowserRefresh"
 180 // "BrowserSearch"
 181 // "BrowserStop"
 182 // "CapsLock"
 183 // "Clear"
 184 keyIdentifierList.set("Clear", VK_CLEAR);
 185 // "CodeInput"
 186 // "Compose"
 187 // "Control"
 188 // "Crsel"
 189 // "Convert"
 190 // "Copy"
 191 // "Cut"
 192 // "Decimal"
 193 // "Divide"
 194 // "Down"
 195 keyIdentifierList.set("Down", VK_DOWN);
 196 // "DownLeft"
 197 // "DownRight"
 198 // "End"
 199 keyIdentifierList.set("End", VK_END);
 200 // "Enter"
 201 keyIdentifierList.set("Enter", VK_RETURN);
 202 // "EraseEof"
 203 // "Execute"
 204 keyIdentifierList.set("Execute", VK_EXECUTE);
 205 // "Exsel"
 206 // "Fn"
 207 // "F1"
 208 keyIdentifierList.set("F1", VK_F1);
 209 // "F2"
 210 keyIdentifierList.set("F2", VK_F2);
 211 // "F3"
 212 keyIdentifierList.set("F3", VK_F3);
 213 // "F4"
 214 keyIdentifierList.set("F4", VK_F4);
 215 // "F5"
 216 keyIdentifierList.set("F5", VK_F5);
 217 // "F6"
 218 keyIdentifierList.set("F6", VK_F6);
 219 // "F7"
 220 keyIdentifierList.set("F7", VK_F7);
 221 // "F8"
 222 keyIdentifierList.set("F8", VK_F8);
 223 // "F9"
 224 keyIdentifierList.set("F9", VK_F9);
 225 // "F10"
 226 keyIdentifierList.set("F10", VK_F10);
 227 // "F11"
 228 keyIdentifierList.set("F11", VK_F11);
 229 // "F12"
 230 keyIdentifierList.set("F12", VK_F12);
 231 // "F13"
 232 keyIdentifierList.set("F13", VK_F13);
 233 // "F14"
 234 keyIdentifierList.set("F14", VK_F14);
 235 // "F15"
 236 keyIdentifierList.set("F15", VK_F15);
 237 // "F16"
 238 keyIdentifierList.set("F16", VK_F16);
 239 // "F17"
 240 keyIdentifierList.set("F17", VK_F17);
 241 // "F18"
 242 keyIdentifierList.set("F18", VK_F18);
 243 // "F19"
 244 keyIdentifierList.set("F19", VK_F19);
 245 // "F20"
 246 keyIdentifierList.set("F20", VK_F20);
 247 // "F21"
 248 keyIdentifierList.set("F21", VK_F21);
 249 // "F22"
 250 keyIdentifierList.set("F22", VK_F22);
 251 // "F23"
 252 keyIdentifierList.set("F23", VK_F23);
 253 // "F24"
 254 keyIdentifierList.set("F24", VK_F24);
 255 // "FinalMode"
 256 // "Find"
 257 // "FullWidth"
 258 // "HalfWidth"
 259 // "HangulMode"
 260 // "HanjaMode"
 261 // "Help"
 262 keyIdentifierList.set("Help", VK_HELP);
 263 // "Hiragana"
 264 // "Home"
 265 keyIdentifierList.set("Home", VK_HOME);
 266 // "Insert"
 267 keyIdentifierList.set("Insert", VK_INSERT);
 268 // "JapaneseHiragana"
 269 // "JapaneseKatakana"
 270 // "JapaneseRomaji"
 271 // "JunjaMode"
 272 // "KanaMode"
 273 // "KanjiMode"
 274 // "Katakana"
 275 // "LaunchApplication1"
 276 // "LaunchApplication2"
 277 // "LaunchMail"
 278 // "Left"
 279 keyIdentifierList.set("Left", VK_LEFT);
 280 // "Menu"
 281 // "Meta"
 282 // "MediaNextTrack"
 283 // "MediaPlayPause"
 284 // "MediaPreviousTrack"
 285 // "MediaStop"
 286 // "ModeChange"
 287 // "Multiply"
 288 // "NextCandidate"
 289 // "Nonconvert"
 290 // "NumLock"
 291 // "PageDown"
 292 keyIdentifierList.set("PageDown", VK_NEXT);
 293 // "PageUp"
 294 keyIdentifierList.set("PageUp", VK_PRIOR);
 295 // "Paste"
 296 // "Pause"
 297 keyIdentifierList.set("Pause", VK_PAUSE);
 298 // "Play"
 299 // "PreviousCandidate"
 300 // "PrintScreen"
 301 keyIdentifierList.set("PrintScreen", VK_SNAPSHOT);
 302 // "Process"
 303 // "Props"
 304 // "Right"
 305 keyIdentifierList.set("Right", VK_RIGHT);
 306 // "RomanCharacters"
 307 // "Scroll"
 308 keyIdentifierList.set("Scroll", VK_SCROLL);
 309 // "Select"
 310 keyIdentifierList.set("Select", VK_SELECT);
 311 // "SelectMedia"
 312 // "Separator"
 313 // "Shift"
 314 // "Soft1"
 315 // "Soft2"
 316 // "Soft3"
 317 // "Soft4"
 318 // "Stop"
 319 // "Subtract"
 320 // "Up"
 321 keyIdentifierList.set("Up", VK_UP);
 322 // "UpLeft"
 323 // "UpRight"
 324 // "Undo"
 325 // "VolumeDown"
 326 // "VolumeMute"
 327 // "VolumeUp"
 328 // "Win"
 329 // "Zoom"
 330 }
 331 return &keyIdentifierList;
 332}
 333
157334}
50865

WebCore/platform/wx/KeyboardEventWx.cpp

2727#include "PlatformKeyboardEvent.h"
2828
2929#include "KeyboardCodes.h"
 30#include "StringHash.h"
 31#include <wtf/HashMap.h>
3032
3133#include <wx/defs.h>
3234#include <wx/event.h>

@@bool PlatformKeyboardEvent::currentCapsL
388390 return wxGetKeyState(WXK_CAPITAL);
389391}
390392
 393HashMap<String, unsigned>* PlatformKeyboardEvent::keyIdentifierList()
 394{
 395 typedef HashMap<String, unsigned> KeyIdentifierMap;
 396 DEFINE_STATIC_LOCAL(KeyIdentifierMap, keyIdentifierList, ());
 397 if (keyIdentifierList.isEmpty()) {
 398 // "Accept"
 399 // "Add"
 400 // "Again"
 401 // "AllCandidates"
 402 // "Alphanumeric"
 403 // "Alt"
 404 keyIdentifierList.set("Alt", WXK_ALT);
 405 // "AltGraph"
 406 // "Apps"
 407 // "Attn"
 408 // "BrowserBack"
 409 // "BrowserFavorites"
 410 // "BrowserForward"
 411 // "BrowserHome"
 412 // "BrowserRefresh"
 413 // "BrowserSearch"
 414 // "BrowserStop"
 415 // "CapsLock"
 416 // "Clear"
 417 keyIdentifierList.set("Clear", WXK_CLEAR);
 418 // "CodeInput"
 419 // "Compose"
 420 // "Control"
 421 // "Crsel"
 422 // "Convert"
 423 // "Copy"
 424 // "Cut"
 425 // "Decimal"
 426 // "Divide"
 427 // "Down"
 428 keyIdentifierList.set("Down", WXK_DOWN);
 429 // "DownLeft"
 430 // "DownRight"
 431 // "End"
 432 keyIdentifierList.set("End", WXK_END);
 433 // "Enter"
 434 keyIdentifierList.set("Enter", WXK_RETURN);
 435 // "EraseEof"
 436 // "Execute"
 437 keyIdentifierList.set("Execute", WXK_EXECUTE);
 438 // "Exsel"
 439 // "Fn"
 440 // "F1"
 441 keyIdentifierList.set("F1", WXK_F1);
 442 // "F2"
 443 keyIdentifierList.set("F2", WXK_F2);
 444 // "F3"
 445 keyIdentifierList.set("F3", WXK_F3);
 446 // "F4"
 447 keyIdentifierList.set("F4", WXK_F4);
 448 // "F5"
 449 keyIdentifierList.set("F5", WXK_F5);
 450 // "F6"
 451 keyIdentifierList.set("F6", WXK_F6);
 452 // "F7"
 453 keyIdentifierList.set("F7", WXK_F7);
 454 // "F8"
 455 keyIdentifierList.set("F8", WXK_F8);
 456 // "F9"
 457 keyIdentifierList.set("F9", WXK_F9);
 458 // "F10"
 459 keyIdentifierList.set("F10", WXK_F10);
 460 // "F11"
 461 keyIdentifierList.set("F11", WXK_F11);
 462 // "F12"
 463 keyIdentifierList.set("F12", WXK_F12);
 464 // "F13"
 465 keyIdentifierList.set("F13", WXK_F13);
 466 // "F14"
 467 keyIdentifierList.set("F14", WXK_F14);
 468 // "F15"
 469 keyIdentifierList.set("F15", WXK_F15);
 470 // "F16"
 471 keyIdentifierList.set("F16", WXK_F16);
 472 // "F17"
 473 keyIdentifierList.set("F17", WXK_F17);
 474 // "F18"
 475 keyIdentifierList.set("F18", WXK_F18);
 476 // "F19"
 477 keyIdentifierList.set("F19", WXK_F19);
 478 // "F20"
 479 keyIdentifierList.set("F20", WXK_F20);
 480 // "F21"
 481 keyIdentifierList.set("F21", WXK_F21);
 482 // "F22"
 483 keyIdentifierList.set("F22", WXK_F22);
 484 // "F23"
 485 keyIdentifierList.set("F23", WXK_F23);
 486 // "F24"
 487 keyIdentifierList.set("F24", WXK_F24);
 488 // "FinalMode"
 489 // "Find"
 490 // "FullWidth"
 491 // "HalfWidth"
 492 // "HangulMode"
 493 // "HanjaMode"
 494 // "Help"
 495 keyIdentifierList.set("Help", WXK_HELP);
 496 // "Hiragana"
 497 // "Home"
 498 keyIdentifierList.set("Home", WXK_HOME);
 499 // "Insert"
 500 keyIdentifierList.set("Insert", WXK_INSERT);
 501 // "JapaneseHiragana"
 502 // "JapaneseKatakana"
 503 // "JapaneseRomaji"
 504 // "JunjaMode"
 505 // "KanaMode"
 506 // "KanjiMode"
 507 // "Katakana"
 508 // "LaunchApplication1"
 509 // "LaunchApplication2"
 510 // "LaunchMail"
 511 // "Left"
 512 keyIdentifierList.set("Left", WXK_LEFT);
 513 // "Menu"
 514 // "Meta"
 515 // "MediaNextTrack"
 516 // "MediaPlayPause"
 517 // "MediaPreviousTrack"
 518 // "MediaStop"
 519 // "ModeChange"
 520 // "Multiply"
 521 // "NextCandidate"
 522 // "Nonconvert"
 523 // "NumLock"
 524 // "PageDown"
 525 keyIdentifierList.set("PageDown", WXK_PAGEDOWN);
 526 // "PageUp"
 527 keyIdentifierList.set("PageUp", WXK_PAGEUP);
 528 // "Paste"
 529 // "Pause"
 530 keyIdentifierList.set("Pause", WXK_PAUSE);
 531 // "Play"
 532 // "PreviousCandidate"
 533 // "PrintScreen"
 534 keyIdentifierList.set("PrintScreen", WXK_PRINT);
 535 // "Process"
 536 // "Props"
 537 // "Right"
 538 keyIdentifierList.set("Right", WXK_RIGHT);
 539 // "RomanCharacters"
 540 // "Scroll"
 541 // "Select"
 542 keyIdentifierList.set("Select", WXK_SELECT);
 543 // "SelectMedia"
 544 // "Separator"
 545 // "Shift"
 546 // "Soft1"
 547 // "Soft2"
 548 // "Soft3"
 549 // "Soft4"
 550 // "Stop"
 551 // "Subtract"
 552 // "Up"
 553 keyIdentifierList.set("Up", WXK_UP);
 554 // "UpLeft"
 555 // "UpRight"
 556 // "Undo"
 557 // "VolumeDown"
 558 // "VolumeMute"
 559 // "VolumeUp"
 560 // "Win"
 561 // "Zoom"
 562 }
 563 return &keyIdentifierList;
 564}
 565
391566}
392567
50865