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. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return KeyboardEvent::DOM_KEY_LOCATION_STANDARD; | 85 return KeyboardEvent::DOM_KEY_LOCATION_STANDARD; |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 KeyboardEventInit::KeyboardEventInit() | 89 KeyboardEventInit::KeyboardEventInit() |
90 : location(0) | 90 : location(0) |
91 , ctrlKey(false) | 91 , ctrlKey(false) |
92 , altKey(false) | 92 , altKey(false) |
93 , shiftKey(false) | 93 , shiftKey(false) |
94 , metaKey(false) | 94 , metaKey(false) |
| 95 , repeat(false) |
95 { | 96 { |
96 } | 97 } |
97 | 98 |
98 KeyboardEvent::KeyboardEvent() | 99 KeyboardEvent::KeyboardEvent() |
99 : m_location(DOM_KEY_LOCATION_STANDARD) | 100 : m_location(DOM_KEY_LOCATION_STANDARD) |
100 , m_altGraphKey(false) | 101 , m_altGraphKey(false) |
| 102 , m_isAutoRepeat(false) |
101 { | 103 { |
102 ScriptWrappable::init(this); | 104 ScriptWrappable::init(this); |
103 } | 105 } |
104 | 106 |
105 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) | 107 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) |
106 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), | 108 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), |
107 true, true, view, 0, key.ctrlKey(), key.altKey(), key.
shiftKey(), key.metaKey()) | 109 true, true, view, 0, key.ctrlKey(), key.altKey(), key.
shiftKey(), key.metaKey()) |
108 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) | 110 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) |
109 , m_keyIdentifier(key.keyIdentifier()) | 111 , m_keyIdentifier(key.keyIdentifier()) |
110 , m_location(keyLocationCode(key)) | 112 , m_location(keyLocationCode(key)) |
111 , m_altGraphKey(false) | 113 , m_altGraphKey(false) |
| 114 , m_isAutoRepeat(key.isAutoRepeat()) |
112 { | 115 { |
113 ScriptWrappable::init(this); | 116 ScriptWrappable::init(this); |
114 } | 117 } |
115 | 118 |
116 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI
nit& initializer) | 119 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI
nit& initializer) |
117 : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable
, initializer.view, initializer.detail, initializer.ctrlKey, initializer.altKey,
initializer.shiftKey, initializer.metaKey) | 120 : UIEventWithKeyState(eventType, initializer.bubbles, initializer.cancelable
, initializer.view, initializer.detail, initializer.ctrlKey, initializer.altKey,
initializer.shiftKey, initializer.metaKey) |
118 , m_keyIdentifier(initializer.keyIdentifier) | 121 , m_keyIdentifier(initializer.keyIdentifier) |
119 , m_location(initializer.location) | 122 , m_location(initializer.location) |
120 , m_altGraphKey(false) | 123 , m_altGraphKey(false) |
| 124 , m_isAutoRepeat(initializer.repeat) |
121 { | 125 { |
122 ScriptWrappable::init(this); | 126 ScriptWrappable::init(this); |
123 } | 127 } |
124 | 128 |
125 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool
cancelable, AbstractView *view, | 129 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool
cancelable, AbstractView *view, |
126 const String &keyIdentifier, unsigned location, | 130 const String &keyIdentifier, unsigned location, |
127 bool ctrlKey, bool altKey, bool shiftKey, bool meta
Key, bool altGraphKey) | 131 bool ctrlKey, bool altKey, bool shiftKey, bool meta
Key, bool altGraphKey) |
128 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al
tKey, shiftKey, metaKey) | 132 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al
tKey, shiftKey, metaKey) |
129 , m_keyIdentifier(keyIdentifier) | 133 , m_keyIdentifier(keyIdentifier) |
130 , m_location(location) | 134 , m_location(location) |
131 , m_altGraphKey(altGraphKey) | 135 , m_altGraphKey(altGraphKey) |
| 136 , m_isAutoRepeat(false) |
132 { | 137 { |
133 ScriptWrappable::init(this); | 138 ScriptWrappable::init(this); |
134 } | 139 } |
135 | 140 |
136 KeyboardEvent::~KeyboardEvent() | 141 KeyboardEvent::~KeyboardEvent() |
137 { | 142 { |
138 } | 143 } |
139 | 144 |
140 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble,
bool cancelable, AbstractView* view, | 145 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble,
bool cancelable, AbstractView* view, |
141 const String &keyIdentifier, unsigned loca
tion, | 146 const String &keyIdentifier, unsigned loca
tion, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 { | 236 { |
232 } | 237 } |
233 | 238 |
234 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c
onst | 239 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c
onst |
235 { | 240 { |
236 // Make sure not to return true if we already took default action while hand
ling the event. | 241 // Make sure not to return true if we already took default action while hand
ling the event. |
237 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); | 242 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default
Handled(); |
238 } | 243 } |
239 | 244 |
240 } // namespace WebCore | 245 } // namespace WebCore |
OLD | NEW |