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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 : m_location(DOM_KEY_LOCATION_STANDARD) | 89 : m_location(DOM_KEY_LOCATION_STANDARD) |
90 , m_isAutoRepeat(false) | 90 , m_isAutoRepeat(false) |
91 { | 91 { |
92 } | 92 } |
93 | 93 |
94 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) | 94 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) |
95 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), | 95 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), |
96 true, true, view, 0, key.ctrlKey(), key.altKey(), key.
shiftKey(), key.metaKey()) | 96 true, true, view, 0, key.ctrlKey(), key.altKey(), key.
shiftKey(), key.metaKey()) |
97 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) | 97 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) |
98 , m_keyIdentifier(key.keyIdentifier()) | 98 , m_keyIdentifier(key.keyIdentifier()) |
| 99 , m_code(key.code()) |
99 , m_location(keyLocationCode(key)) | 100 , m_location(keyLocationCode(key)) |
100 , m_isAutoRepeat(key.isAutoRepeat()) | 101 , m_isAutoRepeat(key.isAutoRepeat()) |
101 { | 102 { |
102 setUICreateTime(key.timestamp()); | 103 setUICreateTime(key.timestamp()); |
103 } | 104 } |
104 | 105 |
105 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI
nit& initializer) | 106 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, const KeyboardEventI
nit& initializer) |
106 : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelab
le(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializ
er.altKey(), initializer.shiftKey(), initializer.metaKey()) | 107 : UIEventWithKeyState(eventType, initializer.bubbles(), initializer.cancelab
le(), initializer.view(), initializer.detail(), initializer.ctrlKey(), initializ
er.altKey(), initializer.shiftKey(), initializer.metaKey()) |
107 , m_keyIdentifier(initializer.keyIdentifier()) | 108 , m_keyIdentifier(initializer.keyIdentifier()) |
108 , m_location(initializer.location()) | 109 , m_location(initializer.location()) |
109 , m_isAutoRepeat(initializer.repeat()) | 110 , m_isAutoRepeat(initializer.repeat()) |
110 { | 111 { |
111 } | 112 } |
112 | 113 |
113 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool
cancelable, AbstractView *view, | 114 KeyboardEvent::KeyboardEvent(const AtomicString& eventType, bool canBubble, bool
cancelable, AbstractView *view, |
114 const String &keyIdentifier, unsigned location, | 115 const String& keyIdentifier, const String& code, unsigned location, bool ctr
lKey, bool altKey, bool shiftKey, bool metaKey) |
115 bool ctrlKey, bool altKey, bool shiftKey, bool meta
Key) | |
116 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al
tKey, shiftKey, metaKey) | 116 : UIEventWithKeyState(eventType, canBubble, cancelable, view, 0, ctrlKey, al
tKey, shiftKey, metaKey) |
117 , m_keyIdentifier(keyIdentifier) | 117 , m_keyIdentifier(keyIdentifier) |
| 118 , m_code(code) |
118 , m_location(location) | 119 , m_location(location) |
119 , m_isAutoRepeat(false) | 120 , m_isAutoRepeat(false) |
120 { | 121 { |
121 } | 122 } |
122 | 123 |
123 KeyboardEvent::~KeyboardEvent() | 124 KeyboardEvent::~KeyboardEvent() |
124 { | 125 { |
125 } | 126 } |
126 | 127 |
127 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble,
bool cancelable, AbstractView* view, | 128 void KeyboardEvent::initKeyboardEvent(const AtomicString& type, bool canBubble,
bool cancelable, AbstractView* view, |
128 const String &keyIdentifier, unsigned loca
tion, | 129 const String& keyIdentifier, unsigned location, bool ctrlKey, bool altKey, b
ool shiftKey, bool metaKey) |
129 bool ctrlKey, bool altKey, bool shiftKey,
bool metaKey) | |
130 { | 130 { |
131 if (dispatched()) | 131 if (dispatched()) |
132 return; | 132 return; |
133 | 133 |
134 initUIEvent(type, canBubble, cancelable, view, 0); | 134 initUIEvent(type, canBubble, cancelable, view, 0); |
135 | 135 |
136 m_keyIdentifier = keyIdentifier; | 136 m_keyIdentifier = keyIdentifier; |
137 m_location = location; | 137 m_location = location; |
138 m_ctrlKey = ctrlKey; | 138 m_ctrlKey = ctrlKey; |
139 m_shiftKey = shiftKey; | 139 m_shiftKey = shiftKey; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 { | 221 { |
222 } | 222 } |
223 | 223 |
224 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c
onst | 224 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c
onst |
225 { | 225 { |
226 // Make sure not to return true if we already took default action while hand
ling the event. | 226 // Make sure not to return true if we already took default action while hand
ling the event. |
227 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); | 227 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); |
228 } | 228 } |
229 | 229 |
230 } // namespace blink | 230 } // namespace blink |
OLD | NEW |