Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: Source/core/events/KeyboardEvent.cpp

Issue 797243003: [Events] Propagate IME composition event to JS on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renaming const to match style elsewhere in Blink. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698