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

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

Issue 21030004: Add support for KeyboardEvent.getModifierState() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 | Annotate | Revision Log
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 m_keyLocation = keyLocation; 150 m_keyLocation = keyLocation;
151 m_ctrlKey = ctrlKey; 151 m_ctrlKey = ctrlKey;
152 m_shiftKey = shiftKey; 152 m_shiftKey = shiftKey;
153 m_altKey = altKey; 153 m_altKey = altKey;
154 m_metaKey = metaKey; 154 m_metaKey = metaKey;
155 m_altGraphKey = altGraphKey; 155 m_altGraphKey = altGraphKey;
156 } 156 }
157 157
158 bool KeyboardEvent::getModifierState(const String& keyIdentifier) const 158 bool KeyboardEvent::getModifierState(const String& keyIdentifier) const
159 { 159 {
160 // FIXME: The following keyIdentifiers are not supported yet (crbug.com/2654 58):
161 // "AltGraph", "CapsLock", "Fn", "NumLock", "ScrollLock", "SymbolLock", "OS" .
garykac 2013/07/29 16:18:00 Note that we're working to clarify some of these k
160 if (keyIdentifier == "Control") 162 if (keyIdentifier == "Control")
161 return ctrlKey(); 163 return ctrlKey();
162 if (keyIdentifier == "Shift") 164 if (keyIdentifier == "Shift")
163 return shiftKey(); 165 return shiftKey();
164 if (keyIdentifier == "Alt") 166 if (keyIdentifier == "Alt")
165 return altKey(); 167 return altKey();
166 if (keyIdentifier == "Meta") 168 if (keyIdentifier == "Meta")
167 return metaKey(); 169 return metaKey();
168 return false; 170 return false;
169 } 171 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 { 231 {
230 } 232 }
231 233
232 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c onst 234 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) c onst
233 { 235 {
234 // Make sure not to return true if we already took default action while hand ling the event. 236 // Make sure not to return true if we already took default action while hand ling the event.
235 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled(); 237 return EventDispatchMediator::dispatchEvent(dispatcher) && !event()->default Handled();
236 } 238 }
237 239
238 } // namespace WebCore 240 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698