| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #else | 49 #else |
| 50 // Can only change type from KeyDown to RawKeyDown or Char, as we lack infor
mation for other conversions. | 50 // Can only change type from KeyDown to RawKeyDown or Char, as we lack infor
mation for other conversions. |
| 51 ASSERT(m_type == PlatformEvent::KeyDown); | 51 ASSERT(m_type == PlatformEvent::KeyDown); |
| 52 ASSERT(type == PlatformEvent::RawKeyDown || type == PlatformEvent::Char); | 52 ASSERT(type == PlatformEvent::RawKeyDown || type == PlatformEvent::Char); |
| 53 m_type = type; | 53 m_type = type; |
| 54 | 54 |
| 55 if (type == RawKeyDown) { | 55 if (type == RawKeyDown) { |
| 56 m_text = String(); | 56 m_text = String(); |
| 57 m_unmodifiedText = String(); | 57 m_unmodifiedText = String(); |
| 58 } else { | 58 } else { |
| 59 m_keyIdentifier = String(); | |
| 60 m_windowsVirtualKeyCode = 0; | 59 m_windowsVirtualKeyCode = 0; |
| 61 #if OS(MACOSX) | 60 #if OS(MACOSX) |
| 62 if (m_text.length() == 1 && (m_text[0U] >= 0xF700 && m_text[0U] <= 0xF7F
F)) { | 61 if (m_text.length() == 1 && (m_text[0U] >= 0xF700 && m_text[0U] <= 0xF7F
F)) { |
| 63 // According to NSEvents.h, OpenStep reserves the range 0xF700-0xF8F
F for function keys. However, some actual private use characters | 62 // According to NSEvents.h, OpenStep reserves the range 0xF700-0xF8F
F for function keys. However, some actual private use characters |
| 64 // happen to be in this range, e.g. the Apple logo (Option+Shift+K). | 63 // happen to be in this range, e.g. the Apple logo (Option+Shift+K). |
| 65 // 0xF7FF is an arbitrary cut-off. | 64 // 0xF7FF is an arbitrary cut-off. |
| 66 m_text = String(); | 65 m_text = String(); |
| 67 m_unmodifiedText = String(); | 66 m_unmodifiedText = String(); |
| 68 } | 67 } |
| 69 #endif | 68 #endif |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (currentModifiers & ::cmdKey) | 122 if (currentModifiers & ::cmdKey) |
| 124 modifiers |= MetaKey; | 123 modifiers |= MetaKey; |
| 125 #else | 124 #else |
| 126 // TODO(crbug.com/538289): Implement on other platforms. | 125 // TODO(crbug.com/538289): Implement on other platforms. |
| 127 return static_cast<Modifiers>(0); | 126 return static_cast<Modifiers>(0); |
| 128 #endif | 127 #endif |
| 129 return static_cast<Modifiers>(modifiers); | 128 return static_cast<Modifiers>(modifiers); |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |