OLD | NEW |
---|---|
1 /** | 1 /** |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "core/events/KeyboardEvent.h" | 24 #include "core/events/KeyboardEvent.h" |
25 | 25 |
26 #include "KeyboardCode.h" | |
Wez
2014/11/20 22:17:33
What is this include required for?
Habib Virji
2014/11/24 15:12:22
Done. It was previous include file that i created,
| |
26 #include "platform/PlatformKeyboardEvent.h" | 27 #include "platform/PlatformKeyboardEvent.h" |
27 #include "platform/WindowsKeyboardCodes.h" | 28 #include "platform/WindowsKeyboardCodes.h" |
28 | 29 |
29 namespace blink { | 30 namespace blink { |
30 | 31 |
31 static inline const AtomicString& eventTypeForKeyboardEventType(PlatformEvent::T ype type) | 32 static inline const AtomicString& eventTypeForKeyboardEventType(PlatformEvent::T ype type) |
32 { | 33 { |
33 switch (type) { | 34 switch (type) { |
34 case PlatformEvent::KeyUp: | 35 case PlatformEvent::KeyUp: |
35 return EventTypeNames::keyup; | 36 return EventTypeNames::keyup; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 { | 102 { |
102 } | 103 } |
103 | 104 |
104 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie w) | 105 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie w) |
105 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), | 106 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), |
106 true, true, view, 0, key.ctrlKey(), key.altKey(), key. shiftKey(), key.metaKey()) | 107 true, true, view, 0, key.ctrlKey(), key.altKey(), key. shiftKey(), key.metaKey()) |
107 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) | 108 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) |
108 , m_keyIdentifier(key.keyIdentifier()) | 109 , m_keyIdentifier(key.keyIdentifier()) |
109 , m_location(keyLocationCode(key)) | 110 , m_location(keyLocationCode(key)) |
110 , m_isAutoRepeat(key.isAutoRepeat()) | 111 , m_isAutoRepeat(key.isAutoRepeat()) |
112 , m_code(key.code()) | |
111 { | 113 { |
112 } | 114 } |
113 | 115 |
114 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI nit& initializer) | 116 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI nit& initializer) |
115 : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable , initializer.view, initializer.detail, initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializer.metaKey) | 117 : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable , initializer.view, initializer.detail, initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializer.metaKey) |
116 , m_keyIdentifier(initializer.keyIdentifier) | 118 , m_keyIdentifier(initializer.keyIdentifier) |
117 , m_location(initializer.location) | 119 , m_location(initializer.location) |
118 , m_isAutoRepeat(initializer.repeat) | 120 , m_isAutoRepeat(initializer.repeat) |
121 , m_code(initializer.code) | |
119 { | 122 { |
120 } | 123 } |
121 | 124 |
122 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view, | 125 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView *view, |
123 const String &keyIdentifier, unsigned location, | 126 const String &keyIdentifier, unsigned location, |
124 bool ctrlKey, bool altKey, bool shiftKey, bool meta Key) | 127 bool ctrlKey, bool altKey, bool shiftKey, bool meta Key) |
125 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al tKey, shiftKey, metaKey) | 128 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al tKey, shiftKey, metaKey) |
126 , m_keyIdentifier(keyIdentifier) | 129 , m_keyIdentifier(keyIdentifier) |
127 , m_location(location) | 130 , m_location(location) |
128 , m_isAutoRepeat(false) | 131 , m_isAutoRepeat(false) |
129 { | 132 { |
130 } | 133 } |
131 | 134 |
132 KeyboardEvent::~KeyboardEvent() | 135 KeyboardEvent::~KeyboardEvent() |
133 { | 136 { |
134 } | 137 } |
135 | 138 |
136 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, | 139 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, |
Wez
2014/11/20 22:17:33
Looks like this and the constructor above also nee
Habib Virji
2014/11/24 15:12:21
Done. Have added in above constructor and updated
| |
137 const String &keyIdentifier, unsigned loca tion, | 140 const String &keyIdentifier, unsigned loca tion, |
138 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) | 141 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) |
139 { | 142 { |
140 if (dispatched()) | 143 if (dispatched()) |
141 return; | 144 return; |
142 | 145 |
143 initUIEvent(type, canBubble, cancelable, view, 0); | 146 initUIEvent(type, canBubble, cancelable, view, 0); |
144 | 147 |
145 m_keyIdentifier = keyIdentifier; | 148 m_keyIdentifier = keyIdentifier; |
146 m_location = location; | 149 m_location = location; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 { | 225 { |
223 } | 226 } |
224 | 227 |
225 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c onst | 228 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c onst |
226 { | 229 { |
227 // Make sure not to return true if we already took default action while hand ling the event. | 230 // Make sure not to return true if we already took default action while hand ling the event. |
228 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled(); | 231 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled(); |
229 } | 232 } |
230 | 233 |
231 } // namespace blink | 234 } // namespace blink |
OLD | NEW |