Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 | 316 |
| 317 if (type == RawKeyDown) { | 317 if (type == RawKeyDown) { |
| 318 m_text = String(); | 318 m_text = String(); |
| 319 m_unmodifiedText = String(); | 319 m_unmodifiedText = String(); |
| 320 } else { | 320 } else { |
| 321 m_keyIdentifier = String(); | 321 m_keyIdentifier = String(); |
| 322 m_windowsVirtualKeyCode = 0; | 322 m_windowsVirtualKeyCode = 0; |
| 323 } | 323 } |
| 324 } | 324 } |
| 325 | 325 |
| 326 // Please refer to bug http://b/issue?id=961192, which talks about Webkit | 326 // Please refer to bug http://b/issue?id=961192, which talks about Webkit |
|
erikchen
2015/12/10 21:48:09
This comment looks out of date. Can you update it,
chongz
2015/12/11 06:38:46
Done.
| |
| 327 // keyboard event handling changes. It also mentions the list of keys | 327 // keyboard event handling changes. It also mentions the list of keys |
| 328 // which don't have associated character events. | 328 // which don't have associated character events. |
| 329 bool PlatformKeyboardEventBuilder::isCharacterKey() const | 329 bool PlatformKeyboardEventBuilder::isCharacterKey() const |
| 330 { | 330 { |
| 331 switch (windowsVirtualKeyCode()) { | 331 if (text().length() == 0) |
| 332 case VKEY_BACK: | |
| 333 case VKEY_ESCAPE: | |
| 334 return false; | 332 return false; |
| 333 | |
| 334 UChar32 c = text().characterStartingAt(0); | |
| 335 switch (c) { | |
| 336 case 0x08: // Backspace | |
| 337 case 0x1B: // Escape | |
| 338 case 0x7F: // Delete | |
| 339 return false; | |
| 340 default: | |
| 341 return true; | |
| 335 } | 342 } |
| 336 return true; | |
| 337 } | 343 } |
| 338 | 344 |
| 339 inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type ty pe) | 345 inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type ty pe) |
| 340 { | 346 { |
| 341 switch (type) { | 347 switch (type) { |
| 342 case WebInputEvent::TouchStart: | 348 case WebInputEvent::TouchStart: |
| 343 return PlatformEvent::TouchStart; | 349 return PlatformEvent::TouchStart; |
| 344 case WebInputEvent::TouchMove: | 350 case WebInputEvent::TouchMove: |
| 345 return PlatformEvent::TouchMove; | 351 return PlatformEvent::TouchMove; |
| 346 case WebInputEvent::TouchEnd: | 352 case WebInputEvent::TouchEnd: |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 725 break; | 731 break; |
| 726 case GestureSourceTouchscreen: | 732 case GestureSourceTouchscreen: |
| 727 sourceDevice = WebGestureDeviceTouchscreen; | 733 sourceDevice = WebGestureDeviceTouchscreen; |
| 728 break; | 734 break; |
| 729 case GestureSourceUninitialized: | 735 case GestureSourceUninitialized: |
| 730 ASSERT_NOT_REACHED(); | 736 ASSERT_NOT_REACHED(); |
| 731 } | 737 } |
| 732 } | 738 } |
| 733 | 739 |
| 734 } // namespace blink | 740 } // namespace blink |
| OLD | NEW |