OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 if (event.type() == eventNames().keydownEvent) | 595 if (event.type() == eventNames().keydownEvent) |
596 type = KeyDown; | 596 type = KeyDown; |
597 else if (event.type() == eventNames().keyupEvent) | 597 else if (event.type() == eventNames().keyupEvent) |
598 type = WebInputEvent::KeyUp; | 598 type = WebInputEvent::KeyUp; |
599 else if (event.type() == eventNames().keypressEvent) | 599 else if (event.type() == eventNames().keypressEvent) |
600 type = WebInputEvent::Char; | 600 type = WebInputEvent::Char; |
601 else | 601 else |
602 return; // Skip all other keyboard events. | 602 return; // Skip all other keyboard events. |
603 | 603 |
604 modifiers = getWebInputModifiers(event); | 604 modifiers = getWebInputModifiers(event); |
605 if (event.keyLocation() == KeyboardEvent::DOMKeyLocationNumpad) | 605 if (event.keyLocation() == KeyboardEvent::DOM_KEY_LOCATION_NUMPAD) |
606 modifiers |= WebInputEvent::IsKeyPad; | 606 modifiers |= WebInputEvent::IsKeyPad; |
607 else if (event.keyLocation() == KeyboardEvent::DOMKeyLocationLeft) | 607 else if (event.keyLocation() == KeyboardEvent::DOM_KEY_LOCATION_LEFT) |
608 modifiers |= WebInputEvent::IsLeft; | 608 modifiers |= WebInputEvent::IsLeft; |
609 else if (event.keyLocation() == KeyboardEvent::DOMKeyLocationRight) | 609 else if (event.keyLocation() == KeyboardEvent::DOM_KEY_LOCATION_RIGHT) |
610 modifiers |= WebInputEvent::IsRight; | 610 modifiers |= WebInputEvent::IsRight; |
611 | 611 |
612 timeStampSeconds = event.timeStamp() / millisPerSecond; | 612 timeStampSeconds = event.timeStamp() / millisPerSecond; |
613 windowsKeyCode = event.keyCode(); | 613 windowsKeyCode = event.keyCode(); |
614 | 614 |
615 // The platform keyevent does not exist if the event was created using | 615 // The platform keyevent does not exist if the event was created using |
616 // initKeyboardEvent. | 616 // initKeyboardEvent. |
617 if (!event.keyEvent()) | 617 if (!event.keyEvent()) |
618 return; | 618 return; |
619 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); | 619 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 modifiers = getWebInputModifiers(event); | 739 modifiers = getWebInputModifiers(event); |
740 | 740 |
741 globalX = event.screenX(); | 741 globalX = event.screenX(); |
742 globalY = event.screenY(); | 742 globalY = event.screenY(); |
743 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); | 743 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL
ocation(), *renderObject); |
744 x = localPoint.x(); | 744 x = localPoint.x(); |
745 y = localPoint.y(); | 745 y = localPoint.y(); |
746 } | 746 } |
747 | 747 |
748 } // namespace WebKit | 748 } // namespace WebKit |
OLD | NEW |