Changeset 106422 in webkit


Ignore:
Timestamp:
Jan 31, 2012 7:21:24 PM (12 years ago)
Author:
ap@apple.com
Message:

REGRESSION (WebKit2): event.keyCode is always zero when typing in Russian
https://bugs.webkit.org/show_bug.cgi?id=77473
<rdar://problem/10751357>

Reviewed by Darin Adler.

Source/WebCore:

Test: platform/mac/fast/events/non-roman-key-code.html

  • WebCore.exp.in:
  • platform/mac/PlatformEventFactoryMac.h:
  • platform/mac/PlatformEventFactoryMac.mm:

(WebCore::keyIdentifierForKeyEvent):
(WebCore::windowsKeyCodeForKeyEvent):
Export functions for reuse in WebKit2. I did not attempt any larger refactoring at this time.

Source/WebKit2:

  • Shared/mac/WebEventFactory.mm: Removed broken copy/pasted implementation in favor of

WebCore ones.

Tools:

  • DumpRenderTree/mac/EventSendingController.mm:

(-[EventSendingController keyDown:withModifiers:withLocation:]):

  • WebKitTestRunner/mac/EventSenderProxy.mm:

(WTR::EventSenderProxy::keyDown):
Added a new special keyDown value to test this.

Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106421 r106422  
     12012-01-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (WebKit2): event.keyCode is always zero when typing in Russian
     4        https://bugs.webkit.org/show_bug.cgi?id=77473
     5        <rdar://problem/10751357>
     6
     7        Reviewed by Darin Adler.
     8
     9        Test: platform/mac/fast/events/non-roman-key-code.html
     10
     11        * WebCore.exp.in:
     12        * platform/mac/PlatformEventFactoryMac.h:
     13        * platform/mac/PlatformEventFactoryMac.mm:
     14        (WebCore::keyIdentifierForKeyEvent):
     15        (WebCore::windowsKeyCodeForKeyEvent):
     16        Export functions for reuse in WebKit2. I did not attempt any larger refactoring at this time.
     17
    1182012-01-31  Gregg Tavares  <gman@google.com>
    219
  • trunk/Source/WebCore/WebCore.exp.in

    r106373 r106422  
    657657__ZN7WebCore24FrameDestructionObserver12observeFrameEPNS_5FrameE
    658658__ZN7WebCore24FrameDestructionObserver14frameDestroyedEv
     659__ZN7WebCore24keyIdentifierForKeyEventEP7NSEvent
    659660__ZN7WebCore24notifyHistoryItemChangedE
    660661__ZN7WebCore25HistoryPropertyListWriter11releaseDataEv
     
    670671__ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiiiNS_7IntSizeE
    671672__ZN7WebCore25contextMenuItemTagOutlineEv
     673__ZN7WebCore25windowsKeyCodeForKeyEventEP7NSEvent
    672674__ZN7WebCore26CSSMutableStyleDeclarationC1Ev
    673675__ZN7WebCore26UserTypingGestureIndicator27processingUserTypingGestureEv
  • trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.h

    r103997 r106422  
    4747};
    4848
     49#if PLATFORM(MAC) && defined(__OBJC__)
    4950// FIXME: This doesn't really belong here.
     51IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *);
    5052
    51 #if PLATFORM(MAC) && defined(__OBJC__)
    52 IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *);
     53// FIXME: WebKit2 has a lot of code copy/pasted from PlatformEventFactoryMac in WebEventFactory. It should be carefully shared with WebCore.
     54int windowsKeyCodeForKeyEvent(NSEvent*);
     55String keyIdentifierForKeyEvent(NSEvent*);
     56
    5357#endif
    5458
  • trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm

    r106021 r106422  
    243243}
    244244
    245 static String keyIdentifierForKeyEvent(NSEvent* event)
     245String keyIdentifierForKeyEvent(NSEvent* event)
    246246{
    247247    if ([event type] == NSFlagsChanged)
     
    319319}
    320320
    321 static int windowsKeyCodeForKeyEvent(NSEvent* event)
     321int windowsKeyCodeForKeyEvent(NSEvent* event)
    322322{
    323323    int code = 0;
  • trunk/Source/WebKit2/ChangeLog

    r106375 r106422  
     12012-01-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (WebKit2): event.keyCode is always zero when typing in Russian
     4        https://bugs.webkit.org/show_bug.cgi?id=77473
     5        <rdar://problem/10751357>
     6
     7        Reviewed by Darin Adler.
     8
     9        * Shared/mac/WebEventFactory.mm: Removed broken copy/pasted implementation in favor of
     10        WebCore ones.
     11
    1122012-01-31  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm

    r106021 r106422  
    2929#import "WebKitSystemInterface.h"
    3030#import <wtf/ASCIICType.h>
     31#import <WebCore/PlatformEventFactoryMac.h>
    3132#import <WebCore/Scrollbar.h>
    3233#import <WebCore/WindowsKeyboardCodes.h>
     
    3536
    3637namespace WebKit {
     38
     39// FIXME: This is a huge copy/paste from WebCore/PlatformEventFactoryMac.mm. The code should be merged.
    3740
    3841static WebMouseEvent::Button currentMouseButton()
     
    276279}
    277280
    278 static String keyIdentifierForKeyEvent(NSEvent* event)
    279 {
    280     if ([event type] == NSFlagsChanged)
    281         switch ([event keyCode]) {
    282             case 54: // Right Command
    283             case 55: // Left Command
    284                 return String("Meta");
    285                
    286             case 57: // Capslock
    287                 return String("CapsLock");
    288                
    289             case 56: // Left Shift
    290             case 60: // Right Shift
    291                 return String("Shift");
    292                
    293             case 58: // Left Alt
    294             case 61: // Right Alt
    295                 return String("Alt");
    296                
    297             case 59: // Left Ctrl
    298             case 62: // Right Ctrl
    299                 return String("Control");
    300                
    301             default:
    302                 ASSERT_NOT_REACHED();
    303                 return String("");
    304         }
    305    
    306     NSString *s = [event charactersIgnoringModifiers];
    307     if ([s length] != 1)
    308         return String("Unidentified");
    309 
    310     unichar c = [s characterAtIndex:0];
    311     switch (c) {
    312         // Each identifier listed in the DOM spec is listed here.
    313         // Many are simply commented out since they do not appear on standard Macintosh keyboards
    314         // or are on a key that doesn't have a corresponding character.
    315 
    316         // "Accept"
    317         // "AllCandidates"
    318 
    319         // "Alt"
    320         case NSMenuFunctionKey:
    321             return String("Alt");
    322 
    323         // "Apps"
    324         // "BrowserBack"
    325         // "BrowserForward"
    326         // "BrowserHome"
    327         // "BrowserRefresh"
    328         // "BrowserSearch"
    329         // "BrowserStop"
    330         // "CapsLock"
    331 
    332         // "Clear"
    333         case NSClearLineFunctionKey:
    334             return String("Clear");
    335 
    336         // "CodeInput"
    337         // "Compose"
    338         // "Control"
    339         // "Crsel"
    340         // "Convert"
    341         // "Copy"
    342         // "Cut"
    343 
    344         // "Down"
    345         case NSDownArrowFunctionKey:
    346             return String("Down");
    347         // "End"
    348         case NSEndFunctionKey:
    349             return String("End");
    350         // "Enter"
    351         case 0x3: case 0xA: case 0xD: // Macintosh calls the one on the main keyboard Return, but Windows calls it Enter, so we'll do the same for the DOM
    352             return String("Enter");
    353 
    354         // "EraseEof"
    355 
    356         // "Execute"
    357         case NSExecuteFunctionKey:
    358             return String("Execute");
    359 
    360         // "Exsel"
    361 
    362         // "F1"
    363         case NSF1FunctionKey:
    364             return String("F1");
    365         // "F2"
    366         case NSF2FunctionKey:
    367             return String("F2");
    368         // "F3"
    369         case NSF3FunctionKey:
    370             return String("F3");
    371         // "F4"
    372         case NSF4FunctionKey:
    373             return String("F4");
    374         // "F5"
    375         case NSF5FunctionKey:
    376             return String("F5");
    377         // "F6"
    378         case NSF6FunctionKey:
    379             return String("F6");
    380         // "F7"
    381         case NSF7FunctionKey:
    382             return String("F7");
    383         // "F8"
    384         case NSF8FunctionKey:
    385             return String("F8");
    386         // "F9"
    387         case NSF9FunctionKey:
    388             return String("F9");
    389         // "F10"
    390         case NSF10FunctionKey:
    391             return String("F10");
    392         // "F11"
    393         case NSF11FunctionKey:
    394             return String("F11");
    395         // "F12"
    396         case NSF12FunctionKey:
    397             return String("F12");
    398         // "F13"
    399         case NSF13FunctionKey:
    400             return String("F13");
    401         // "F14"
    402         case NSF14FunctionKey:
    403             return String("F14");
    404         // "F15"
    405         case NSF15FunctionKey:
    406             return String("F15");
    407         // "F16"
    408         case NSF16FunctionKey:
    409             return String("F16");
    410         // "F17"
    411         case NSF17FunctionKey:
    412             return String("F17");
    413         // "F18"
    414         case NSF18FunctionKey:
    415             return String("F18");
    416         // "F19"
    417         case NSF19FunctionKey:
    418             return String("F19");
    419         // "F20"
    420         case NSF20FunctionKey:
    421             return String("F20");
    422         // "F21"
    423         case NSF21FunctionKey:
    424             return String("F21");
    425         // "F22"
    426         case NSF22FunctionKey:
    427             return String("F22");
    428         // "F23"
    429         case NSF23FunctionKey:
    430             return String("F23");
    431         // "F24"
    432         case NSF24FunctionKey:
    433             return String("F24");
    434 
    435         // "FinalMode"
    436 
    437         // "Find"
    438         case NSFindFunctionKey:
    439             return String("Find");
    440 
    441         // "FullWidth"
    442         // "HalfWidth"
    443         // "HangulMode"
    444         // "HanjaMode"
    445 
    446         // "Help"
    447         case NSHelpFunctionKey:
    448             return String("Help");
    449 
    450         // "Hiragana"
    451 
    452         // "Home"
    453         case NSHomeFunctionKey:
    454             return String("Home");
    455         // "Insert"
    456         case NSInsertFunctionKey:
    457             return String("Insert");
    458 
    459         // "JapaneseHiragana"
    460         // "JapaneseKatakana"
    461         // "JapaneseRomaji"
    462         // "JunjaMode"
    463         // "KanaMode"
    464         // "KanjiMode"
    465         // "Katakana"
    466         // "LaunchApplication1"
    467         // "LaunchApplication2"
    468         // "LaunchMail"
    469 
    470         // "Left"
    471         case NSLeftArrowFunctionKey:
    472             return String("Left");
    473 
    474         // "Meta"
    475         // "MediaNextTrack"
    476         // "MediaPlayPause"
    477         // "MediaPreviousTrack"
    478         // "MediaStop"
    479 
    480         // "ModeChange"
    481         case NSModeSwitchFunctionKey:
    482             return String("ModeChange");
    483 
    484         // "Nonconvert"
    485         // "NumLock"
    486 
    487         // "PageDown"
    488         case NSPageDownFunctionKey:
    489             return String("PageDown");
    490         // "PageUp"
    491         case NSPageUpFunctionKey:
    492             return String("PageUp");
    493 
    494         // "Paste"
    495 
    496         // "Pause"
    497         case NSPauseFunctionKey:
    498             return String("Pause");
    499 
    500         // "Play"
    501         // "PreviousCandidate"
    502 
    503         // "PrintScreen"
    504         case NSPrintScreenFunctionKey:
    505             return String("PrintScreen");
    506 
    507         // "Process"
    508         // "Props"
    509 
    510         // "Right"
    511         case NSRightArrowFunctionKey:
    512             return String("Right");
    513 
    514         // "RomanCharacters"
    515 
    516         // "Scroll"
    517         case NSScrollLockFunctionKey:
    518             return String("Scroll");
    519         // "Select"
    520         case NSSelectFunctionKey:
    521             return String("Select");
    522 
    523         // "SelectMedia"
    524         // "Shift"
    525 
    526         // "Stop"
    527         case NSStopFunctionKey:
    528             return String("Stop");
    529         // "Up"
    530         case NSUpArrowFunctionKey:
    531             return String("Up");
    532         // "Undo"
    533         case NSUndoFunctionKey:
    534             return String("Undo");
    535 
    536         // "VolumeDown"
    537         // "VolumeMute"
    538         // "VolumeUp"
    539         // "Win"
    540         // "Zoom"
    541 
    542         // More function keys, not in the key identifier specification.
    543         case NSF25FunctionKey:
    544             return String("F25");
    545         case NSF26FunctionKey:
    546             return String("F26");
    547         case NSF27FunctionKey:
    548             return String("F27");
    549         case NSF28FunctionKey:
    550             return String("F28");
    551         case NSF29FunctionKey:
    552             return String("F29");
    553         case NSF30FunctionKey:
    554             return String("F30");
    555         case NSF31FunctionKey:
    556             return String("F31");
    557         case NSF32FunctionKey:
    558             return String("F32");
    559         case NSF33FunctionKey:
    560             return String("F33");
    561         case NSF34FunctionKey:
    562             return String("F34");
    563         case NSF35FunctionKey:
    564             return String("F35");
    565 
    566         // Turn 0x7F into 0x08, because backspace needs to always be 0x08.
    567         case 0x7F:
    568             return String("U+0008");
    569         // Standard says that DEL becomes U+007F.
    570         case NSDeleteFunctionKey:
    571             return String("U+007F");
    572            
    573         // Always use 0x09 for tab instead of AppKit's backtab character.
    574         case NSBackTabCharacter:
    575             return String("U+0009");
    576 
    577         case NSBeginFunctionKey:
    578         case NSBreakFunctionKey:
    579         case NSClearDisplayFunctionKey:
    580         case NSDeleteCharFunctionKey:
    581         case NSDeleteLineFunctionKey:
    582         case NSInsertCharFunctionKey:
    583         case NSInsertLineFunctionKey:
    584         case NSNextFunctionKey:
    585         case NSPrevFunctionKey:
    586         case NSPrintFunctionKey:
    587         case NSRedoFunctionKey:
    588         case NSResetFunctionKey:
    589         case NSSysReqFunctionKey:
    590         case NSSystemFunctionKey:
    591         case NSUserFunctionKey:
    592             // FIXME: We should use something other than the vendor-area Unicode values for the above keys.
    593             // For now, just fall through to the default.
    594         default:
    595             return String::format("U+%04X", toASCIIUpper(c));
    596     }
    597 }
    598 
    599281static bool isKeypadEvent(NSEvent* event)
    600282{
     
    632314     
    633315     return false;
    634 }
    635 
    636 static int windowsKeyCodeForKeyEvent(NSEvent* event)
    637 {
    638     switch ([event keyCode]) {
    639         // VK_TAB (09) TAB key
    640         case 48: return 0x09;
    641 
    642         // VK_APPS (5D) Right windows/meta key
    643         case 54: // Right Command
    644             return 0x5D;
    645            
    646         // VK_LWIN (5B) Left windows/meta key
    647         case 55: // Left Command
    648             return 0x5B;
    649            
    650         // VK_CAPITAL (14) caps locks key
    651         case 57: // Capslock
    652             return 0x14;
    653            
    654         // VK_SHIFT (10) either shift key
    655         case 56: // Left Shift
    656         case 60: // Right Shift
    657             return 0x10;
    658            
    659         // VK_MENU (12) either alt key
    660         case 58: // Left Alt
    661         case 61: // Right Alt
    662             return 0x12;
    663            
    664         // VK_CONTROL (11) either ctrl key
    665         case 59: // Left Ctrl
    666         case 62: // Right Ctrl
    667             return 0x11;
    668            
    669         // VK_CLEAR (0C) CLEAR key
    670         case 71: return 0x0C;
    671 
    672         // VK_NUMPAD0 (60) Numeric keypad 0 key
    673         case 82: return 0x60;
    674         // VK_NUMPAD1 (61) Numeric keypad 1 key
    675         case 83: return 0x61;
    676         // VK_NUMPAD2 (62) Numeric keypad 2 key
    677         case 84: return 0x62;
    678         // VK_NUMPAD3 (63) Numeric keypad 3 key
    679         case 85: return 0x63;
    680         // VK_NUMPAD4 (64) Numeric keypad 4 key
    681         case 86: return 0x64;
    682         // VK_NUMPAD5 (65) Numeric keypad 5 key
    683         case 87: return 0x65;
    684         // VK_NUMPAD6 (66) Numeric keypad 6 key
    685         case 88: return 0x66;
    686         // VK_NUMPAD7 (67) Numeric keypad 7 key
    687         case 89: return 0x67;
    688         // VK_NUMPAD8 (68) Numeric keypad 8 key
    689         case 91: return 0x68;
    690         // VK_NUMPAD9 (69) Numeric keypad 9 key
    691         case 92: return 0x69;
    692         // VK_MULTIPLY (6A) Multiply key
    693         case 67: return 0x6A;
    694         // VK_ADD (6B) Add key
    695         case 69: return 0x6B;
    696 
    697         // VK_SUBTRACT (6D) Subtract key
    698         case 78: return 0x6D;
    699         // VK_DECIMAL (6E) Decimal key
    700         case 65: return 0x6E;
    701         // VK_DIVIDE (6F) Divide key
    702         case 75: return 0x6F;
    703      }
    704    
    705     if ([event type] == NSFlagsChanged)
    706         return 0;
    707 
    708     NSString* s = [event charactersIgnoringModifiers];
    709     if ([s length] != 1)
    710         return 0;
    711 
    712     switch ([s characterAtIndex:0]) {
    713         // VK_LBUTTON (01) Left mouse button
    714         // VK_RBUTTON (02) Right mouse button
    715         // VK_CANCEL (03) Control-break processing
    716         // VK_MBUTTON (04) Middle mouse button (three-button mouse)
    717         // VK_XBUTTON1 (05)
    718         // VK_XBUTTON2 (06)
    719 
    720         // VK_BACK (08) BACKSPACE key
    721         case 8: case 0x7F: return 0x08;
    722         // VK_TAB (09) TAB key
    723         case 9: return 0x09;
    724 
    725         // VK_CLEAR (0C) CLEAR key
    726         // handled by key code above
    727 
    728         // VK_RETURN (0D)
    729         case 0xD: case 3: return 0x0D;
    730 
    731         // VK_SHIFT (10) SHIFT key
    732         // VK_CONTROL (11) CTRL key
    733         // VK_MENU (12) ALT key
    734 
    735         // VK_PAUSE (13) PAUSE key
    736         case NSPauseFunctionKey: return 0x13;
    737 
    738         // VK_CAPITAL (14) CAPS LOCK key
    739         // VK_KANA (15) Input Method Editor (IME) Kana mode
    740         // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
    741         // VK_HANGUL (15) IME Hangul mode
    742         // VK_JUNJA (17) IME Junja mode
    743         // VK_FINAL (18) IME final mode
    744         // VK_HANJA (19) IME Hanja mode
    745         // VK_KANJI (19) IME Kanji mode
    746 
    747         // VK_ESCAPE (1B) ESC key
    748         case 0x1B: return 0x1B;
    749 
    750         // VK_CONVERT (1C) IME convert
    751         // VK_NONCONVERT (1D) IME nonconvert
    752         // VK_ACCEPT (1E) IME accept
    753         // VK_MODECHANGE (1F) IME mode change request
    754 
    755         // VK_SPACE (20) SPACEBAR
    756         case ' ': return 0x20;
    757         // VK_PRIOR (21) PAGE UP key
    758         case NSPageUpFunctionKey: return 0x21;
    759         // VK_NEXT (22) PAGE DOWN key
    760         case NSPageDownFunctionKey: return 0x22;
    761         // VK_END (23) END key
    762         case NSEndFunctionKey: return 0x23;
    763         // VK_HOME (24) HOME key
    764         case NSHomeFunctionKey: return 0x24;
    765         // VK_LEFT (25) LEFT ARROW key
    766         case NSLeftArrowFunctionKey: return 0x25;
    767         // VK_UP (26) UP ARROW key
    768         case NSUpArrowFunctionKey: return 0x26;
    769         // VK_RIGHT (27) RIGHT ARROW key
    770         case NSRightArrowFunctionKey: return 0x27;
    771         // VK_DOWN (28) DOWN ARROW key
    772         case NSDownArrowFunctionKey: return 0x28;
    773         // VK_SELECT (29) SELECT key
    774         case NSSelectFunctionKey: return 0x29;
    775         // VK_PRINT (2A) PRINT key
    776         case NSPrintFunctionKey: return 0x2A;
    777         // VK_EXECUTE (2B) EXECUTE key
    778         case NSExecuteFunctionKey: return 0x2B;
    779         // VK_SNAPSHOT (2C) PRINT SCREEN key
    780         case NSPrintScreenFunctionKey: return 0x2C;
    781         // VK_INSERT (2D) INS key
    782         case NSInsertFunctionKey: case NSHelpFunctionKey: return 0x2D;
    783         // VK_DELETE (2E) DEL key
    784         case NSDeleteFunctionKey: return 0x2E;
    785 
    786         // VK_HELP (2F) HELP key
    787 
    788         //  (30) 0 key
    789         case '0': case ')': return 0x30;
    790         //  (31) 1 key
    791         case '1': case '!': return 0x31;
    792         //  (32) 2 key
    793         case '2': case '@': return 0x32;
    794         //  (33) 3 key
    795         case '3': case '#': return 0x33;
    796         //  (34) 4 key
    797         case '4': case '$': return 0x34;
    798         //  (35) 5 key
    799         case '5': case '%': return 0x35;
    800         //  (36) 6 key
    801         case '6': case '^': return 0x36;
    802         //  (37) 7 key
    803         case '7': case '&': return 0x37;
    804         //  (38) 8 key
    805         case '8': case '*': return 0x38;
    806         //  (39) 9 key
    807         case '9': case '(': return 0x39;
    808         //  (41) A key
    809         case 'a': case 'A': return 0x41;
    810         //  (42) B key
    811         case 'b': case 'B': return 0x42;
    812         //  (43) C key
    813         case 'c': case 'C': return 0x43;
    814         //  (44) D key
    815         case 'd': case 'D': return 0x44;
    816         //  (45) E key
    817         case 'e': case 'E': return 0x45;
    818         //  (46) F key
    819         case 'f': case 'F': return 0x46;
    820         //  (47) G key
    821         case 'g': case 'G': return 0x47;
    822         //  (48) H key
    823         case 'h': case 'H': return 0x48;
    824         //  (49) I key
    825         case 'i': case 'I': return 0x49;
    826         //  (4A) J key
    827         case 'j': case 'J': return 0x4A;
    828         //  (4B) K key
    829         case 'k': case 'K': return 0x4B;
    830         //  (4C) L key
    831         case 'l': case 'L': return 0x4C;
    832         //  (4D) M key
    833         case 'm': case 'M': return 0x4D;
    834         //  (4E) N key
    835         case 'n': case 'N': return 0x4E;
    836         //  (4F) O key
    837         case 'o': case 'O': return 0x4F;
    838         //  (50) P key
    839         case 'p': case 'P': return 0x50;
    840         //  (51) Q key
    841         case 'q': case 'Q': return 0x51;
    842         //  (52) R key
    843         case 'r': case 'R': return 0x52;
    844         //  (53) S key
    845         case 's': case 'S': return 0x53;
    846         //  (54) T key
    847         case 't': case 'T': return 0x54;
    848         //  (55) U key
    849         case 'u': case 'U': return 0x55;
    850         //  (56) V key
    851         case 'v': case 'V': return 0x56;
    852         //  (57) W key
    853         case 'w': case 'W': return 0x57;
    854         //  (58) X key
    855         case 'x': case 'X': return 0x58;
    856         //  (59) Y key
    857         case 'y': case 'Y': return 0x59;
    858         //  (5A) Z key
    859         case 'z': case 'Z': return 0x5A;
    860 
    861         // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
    862         // VK_RWIN (5C) Right Windows key (Natural keyboard)
    863         // VK_APPS (5D) Applications key (Natural keyboard)
    864         // VK_SLEEP (5F) Computer Sleep key
    865 
    866         // VK_NUMPAD0 (60) Numeric keypad 0 key
    867         // VK_NUMPAD1 (61) Numeric keypad 1 key
    868         // VK_NUMPAD2 (62) Numeric keypad 2 key
    869         // VK_NUMPAD3 (63) Numeric keypad 3 key
    870         // VK_NUMPAD4 (64) Numeric keypad 4 key
    871         // VK_NUMPAD5 (65) Numeric keypad 5 key
    872         // VK_NUMPAD6 (66) Numeric keypad 6 key
    873         // VK_NUMPAD7 (67) Numeric keypad 7 key
    874         // VK_NUMPAD8 (68) Numeric keypad 8 key
    875         // VK_NUMPAD9 (69) Numeric keypad 9 key
    876         // VK_MULTIPLY (6A) Multiply key
    877         // VK_ADD (6B) Add key
    878         // handled by key code above
    879 
    880         // VK_SEPARATOR (6C) Separator key
    881 
    882         // VK_SUBTRACT (6D) Subtract key
    883         // VK_DECIMAL (6E) Decimal key
    884         // VK_DIVIDE (6F) Divide key
    885         // handled by key code above
    886 
    887         // VK_F1 (70) F1 key
    888         case NSF1FunctionKey: return 0x70;
    889         // VK_F2 (71) F2 key
    890         case NSF2FunctionKey: return 0x71;
    891         // VK_F3 (72) F3 key
    892         case NSF3FunctionKey: return 0x72;
    893         // VK_F4 (73) F4 key
    894         case NSF4FunctionKey: return 0x73;
    895         // VK_F5 (74) F5 key
    896         case NSF5FunctionKey: return 0x74;
    897         // VK_F6 (75) F6 key
    898         case NSF6FunctionKey: return 0x75;
    899         // VK_F7 (76) F7 key
    900         case NSF7FunctionKey: return 0x76;
    901         // VK_F8 (77) F8 key
    902         case NSF8FunctionKey: return 0x77;
    903         // VK_F9 (78) F9 key
    904         case NSF9FunctionKey: return 0x78;
    905         // VK_F10 (79) F10 key
    906         case NSF10FunctionKey: return 0x79;
    907         // VK_F11 (7A) F11 key
    908         case NSF11FunctionKey: return 0x7A;
    909         // VK_F12 (7B) F12 key
    910         case NSF12FunctionKey: return 0x7B;
    911         // VK_F13 (7C) F13 key
    912         case NSF13FunctionKey: return 0x7C;
    913         // VK_F14 (7D) F14 key
    914         case NSF14FunctionKey: return 0x7D;
    915         // VK_F15 (7E) F15 key
    916         case NSF15FunctionKey: return 0x7E;
    917         // VK_F16 (7F) F16 key
    918         case NSF16FunctionKey: return 0x7F;
    919         // VK_F17 (80H) F17 key
    920         case NSF17FunctionKey: return 0x80;
    921         // VK_F18 (81H) F18 key
    922         case NSF18FunctionKey: return 0x81;
    923         // VK_F19 (82H) F19 key
    924         case NSF19FunctionKey: return 0x82;
    925         // VK_F20 (83H) F20 key
    926         case NSF20FunctionKey: return 0x83;
    927         // VK_F21 (84H) F21 key
    928         case NSF21FunctionKey: return 0x84;
    929         // VK_F22 (85H) F22 key
    930         case NSF22FunctionKey: return 0x85;
    931         // VK_F23 (86H) F23 key
    932         case NSF23FunctionKey: return 0x86;
    933         // VK_F24 (87H) F24 key
    934         case NSF24FunctionKey: return 0x87;
    935 
    936         // VK_NUMLOCK (90) NUM LOCK key
    937 
    938         // VK_SCROLL (91) SCROLL LOCK key
    939         case NSScrollLockFunctionKey: return 0x91;
    940 
    941         // VK_LSHIFT (A0) Left SHIFT key
    942         // VK_RSHIFT (A1) Right SHIFT key
    943         // VK_LCONTROL (A2) Left CONTROL key
    944         // VK_RCONTROL (A3) Right CONTROL key
    945         // VK_LMENU (A4) Left MENU key
    946         // VK_RMENU (A5) Right MENU key
    947         // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
    948         // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
    949         // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
    950         // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
    951         // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
    952         // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
    953         // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
    954         // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
    955         // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
    956         // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
    957         // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
    958         // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
    959         // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
    960         // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
    961         // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
    962         // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
    963         // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
    964         // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
    965 
    966         // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
    967         case ';': case ':': return 0xBA;
    968         // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
    969         case '=': case '+': return 0xBB;
    970         // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
    971         case ',': case '<': return 0xBC;
    972         // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
    973         case '-': case '_': return 0xBD;
    974         // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
    975         case '.': case '>': return 0xBE;
    976         // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
    977         case '/': case '?': return 0xBF;
    978         // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
    979         case '`': case '~': return 0xC0;
    980         // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
    981         case '[': case '{': return 0xDB;
    982         // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
    983         case '\\': case '|': return 0xDC;
    984         // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
    985         case ']': case '}': return 0xDD;
    986         // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
    987         case '\'': case '"': return 0xDE;
    988 
    989         // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
    990         // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
    991         // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
    992         // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
    993         // VK_ATTN (F6) Attn key
    994         // VK_CRSEL (F7) CrSel key
    995         // VK_EXSEL (F8) ExSel key
    996         // VK_EREOF (F9) Erase EOF key
    997         // VK_PLAY (FA) Play key
    998         // VK_ZOOM (FB) Zoom key
    999         // VK_NONAME (FC) Reserved for future use
    1000         // VK_PA1 (FD) PA1 key
    1001         // VK_OEM_CLEAR (FE) Clear key
    1002     }
    1003 
    1004     return 0;
    1005316}
    1006317
  • trunk/Tools/ChangeLog

    r106416 r106422  
     12012-01-31  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (WebKit2): event.keyCode is always zero when typing in Russian
     4        https://bugs.webkit.org/show_bug.cgi?id=77473
     5        <rdar://problem/10751357>
     6
     7        Reviewed by Darin Adler.
     8
     9        * DumpRenderTree/mac/EventSendingController.mm:
     10        (-[EventSendingController keyDown:withModifiers:withLocation:]):
     11        * WebKitTestRunner/mac/EventSenderProxy.mm:
     12        (WTR::EventSenderProxy::keyDown):
     13        Added a new special keyDown value to test this.
     14
    1152012-01-31  Dirk Pranke  <dpranke@chromium.org>
    216
  • trunk/Tools/DumpRenderTree/mac/EventSendingController.mm

    r85036 r106422  
    615615        eventCharacter = [NSString stringWithCharacters:&ch length:1];
    616616        keyCode = 0x0; // There is no known virtual key code for PrintScreen.
     617    } else if ([character isEqualToString:@"cyrillicSmallLetterA"]) {
     618        const unichar ch = 0x0430;
     619        eventCharacter = [NSString stringWithCharacters:&ch length:1];
     620        keyCode = 0x3; // Shares key with "F" on Russian layout.
    617621    }
    618622
  • trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm

    r96439 r106422  
    249249        eventCharacter = [NSString stringWithCharacters:&ch length:1];
    250250        keyCode = 0x0; // There is no known virtual key code for PrintScreen.
     251    } else if ([character isEqualToString:@"cyrillicSmallLetterA"]) {
     252        const unichar ch = 0x0430;
     253        eventCharacter = [NSString stringWithCharacters:&ch length:1];
     254        keyCode = 0x3; // Shares key with "F" on Russian layout.
    251255    }
    252256
Note: See TracChangeset for help on using the changeset viewer.