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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 const AtomicString& KeyboardEvent::InterfaceName() const { | 182 const AtomicString& KeyboardEvent::InterfaceName() const { |
183 return EventNames::KeyboardEvent; | 183 return EventNames::KeyboardEvent; |
184 } | 184 } |
185 | 185 |
186 bool KeyboardEvent::IsKeyboardEvent() const { | 186 bool KeyboardEvent::IsKeyboardEvent() const { |
187 return true; | 187 return true; |
188 } | 188 } |
189 | 189 |
190 int KeyboardEvent::which() const { | 190 unsigned KeyboardEvent::which() const { |
191 // Netscape's "which" returns a virtual key code for keydown and keyup, and a | 191 // Netscape's "which" returns a virtual key code for keydown and keyup, and a |
192 // character code for keypress. That's exactly what IE's "keyCode" returns. | 192 // character code for keypress. That's exactly what IE's "keyCode" returns. |
193 // So they are the same for keyboard events. | 193 // So they are the same for keyboard events. |
194 return keyCode(); | 194 return (unsigned)keyCode(); |
195 } | 195 } |
196 | 196 |
197 void KeyboardEvent::InitLocationModifiers(unsigned location) { | 197 void KeyboardEvent::InitLocationModifiers(unsigned location) { |
198 switch (location) { | 198 switch (location) { |
199 case KeyboardEvent::kDomKeyLocationNumpad: | 199 case KeyboardEvent::kDomKeyLocationNumpad: |
200 modifiers_ |= WebInputEvent::kIsKeyPad; | 200 modifiers_ |= WebInputEvent::kIsKeyPad; |
201 break; | 201 break; |
202 case KeyboardEvent::kDomKeyLocationLeft: | 202 case KeyboardEvent::kDomKeyLocationLeft: |
203 modifiers_ |= WebInputEvent::kIsLeft; | 203 modifiers_ |= WebInputEvent::kIsLeft; |
204 break; | 204 break; |
205 case KeyboardEvent::kDomKeyLocationRight: | 205 case KeyboardEvent::kDomKeyLocationRight: |
206 modifiers_ |= WebInputEvent::kIsRight; | 206 modifiers_ |= WebInputEvent::kIsRight; |
207 break; | 207 break; |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 DEFINE_TRACE(KeyboardEvent) { | 211 DEFINE_TRACE(KeyboardEvent) { |
212 UIEventWithKeyState::Trace(visitor); | 212 UIEventWithKeyState::Trace(visitor); |
213 } | 213 } |
214 | 214 |
215 } // namespace blink | 215 } // namespace blink |
OLD | NEW |