| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 | 158 |
| 159 int KeyboardEvent::keyCode() const | 159 int KeyboardEvent::keyCode() const |
| 160 { | 160 { |
| 161 // IE: virtual key code for keyup/keydown, character code for keypress | 161 // IE: virtual key code for keyup/keydown, character code for keypress |
| 162 // Firefox: virtual key code for keyup/keydown, zero for keypress | 162 // Firefox: virtual key code for keyup/keydown, zero for keypress |
| 163 // We match IE. | 163 // We match IE. |
| 164 if (!m_keyEvent) | 164 if (!m_keyEvent) |
| 165 return 0; | 165 return 0; |
| 166 |
| 167 #if OS(ANDROID) |
| 168 // FIXME: Check to see if this applies to other OS. |
| 169 // If the key event belongs to IME composition then propagate to JS. |
| 170 if (m_keyEvent->nativeVirtualKeyCode() == 0xE5) // VKEY_PROCESSKEY |
| 171 return m_keyEvent->nativeVirtualKeyCode(); |
| 172 #endif |
| 173 |
| 166 if (type() == EventTypeNames::keydown || type() == EventTypeNames::keyup) | 174 if (type() == EventTypeNames::keydown || type() == EventTypeNames::keyup) |
| 167 return windowsVirtualKeyCodeWithoutLocation(m_keyEvent->windowsVirtualKe
yCode()); | 175 return windowsVirtualKeyCodeWithoutLocation(m_keyEvent->windowsVirtualKe
yCode()); |
| 168 | 176 |
| 169 return charCode(); | 177 return charCode(); |
| 170 } | 178 } |
| 171 | 179 |
| 172 int KeyboardEvent::charCode() const | 180 int KeyboardEvent::charCode() const |
| 173 { | 181 { |
| 174 // IE: not supported | 182 // IE: not supported |
| 175 // Firefox: 0 for keydown/keyup events, character code for keypress | 183 // Firefox: 0 for keydown/keyup events, character code for keypress |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 { | 221 { |
| 214 } | 222 } |
| 215 | 223 |
| 216 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c
onst | 224 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c
onst |
| 217 { | 225 { |
| 218 // 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. |
| 219 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); | 227 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH
andled(); |
| 220 } | 228 } |
| 221 | 229 |
| 222 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |