| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // The modifier constants cannot change their values since pepper | 148 // The modifier constants cannot change their values since pepper |
| 149 // does a 1-1 mapping of its values; see | 149 // does a 1-1 mapping of its values; see |
| 150 // content/renderer/pepper/event_conversion.cc | 150 // content/renderer/pepper/event_conversion.cc |
| 151 // | 151 // |
| 152 // A Java counterpart will be generated for this enum. | 152 // A Java counterpart will be generated for this enum. |
| 153 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web | 153 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.blink_public.web |
| 154 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier | 154 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: WebInputEventModifier |
| 155 enum Modifiers { | 155 enum Modifiers { |
| 156 // modifiers for all events: | 156 // modifiers for all events: |
| 157 ShiftKey = 1 << 0, | 157 ShiftKey = 1 << 0, |
| 158 ControlKey = 1 << 1, | 158 ControlKey = 1 << 1, |
| 159 AltKey = 1 << 2, | 159 AltKey = 1 << 2, |
| 160 MetaKey = 1 << 3, | 160 MetaKey = 1 << 3, |
| 161 | 161 |
| 162 // modifiers for keyboard events: | 162 // modifiers for keyboard events: |
| 163 IsKeyPad = 1 << 4, | 163 IsKeyPad = 1 << 4, |
| 164 IsAutoRepeat = 1 << 5, | 164 IsAutoRepeat = 1 << 5, |
| 165 | 165 |
| 166 // modifiers for mouse events: | 166 // modifiers for mouse events: |
| 167 LeftButtonDown = 1 << 6, | 167 LeftButtonDown = 1 << 6, |
| 168 MiddleButtonDown = 1 << 7, | 168 MiddleButtonDown = 1 << 7, |
| 169 RightButtonDown = 1 << 8, | 169 RightButtonDown = 1 << 8, |
| 170 | 170 |
| 171 // Toggle modifers for all events. | 171 // Toggle modifers for all events. |
| 172 CapsLockOn = 1 << 9, | 172 CapsLockOn = 1 << 9, |
| 173 NumLockOn = 1 << 10, | 173 NumLockOn = 1 << 10, |
| 174 | 174 |
| 175 IsLeft = 1 << 11, | 175 IsLeft = 1 << 11, |
| 176 IsRight = 1 << 12, | 176 IsRight = 1 << 12, |
| 177 | 177 |
| 178 // Indicates that an event was generated on the touch screen while | 178 // Indicates that an event was generated on the touch screen while |
| 179 // touch accessibility is enabled, so the event should be handled | 179 // touch accessibility is enabled, so the event should be handled |
| 180 // by accessibility code first before normal input event processing. | 180 // by accessibility code first before normal input event processing. |
| 181 IsTouchAccessibility = 1 << 13, | 181 IsTouchAccessibility = 1 << 13, |
| 182 | 182 |
| 183 IsComposing = 1 << 14, | 183 IsComposing = 1 << 14, |
| 184 | 184 |
| 185 AltGrKey = 1 << 15, | 185 AltGrKey = 1 << 15, |
| 186 FnKey = 1 << 16, | 186 FnKey = 1 << 16, |
| 187 SymbolKey = 1 << 17, | 187 SymbolKey = 1 << 17, |
| 188 | 188 |
| 189 ScrollLockOn = 1 << 18, | 189 ScrollLockOn = 1 << 18, |
| 190 |
| 191 // The set of non-stateful modifiers that specifically change the |
| 192 // interpretation of the key being pressed. For example; IsLeft, |
| 193 // IsRight, IsComposing don't change the meaning of the key |
| 194 // being pressed. NumLockOn, ScrollLockOn, CapsLockOn are stateful |
| 195 // and don't indicate explicit depressed state. |
| 196 KeyModifiers = SymbolKey | FnKey | AltGrKey | MetaKey | AltKey | Control
Key | ShiftKey |
| 190 }; | 197 }; |
| 191 | 198 |
| 192 // Indicates whether the browser needs to block on the ACK result for | 199 // Indicates whether the browser needs to block on the ACK result for |
| 193 // this event, and if not why note (for metrics/diagnostics purposes). | 200 // this event, and if not why note (for metrics/diagnostics purposes). |
| 194 // These values are direct mappings of the values in PlatformEvent | 201 // These values are direct mappings of the values in PlatformEvent |
| 195 // so the values can be cast between the enumerations. static_asserts | 202 // so the values can be cast between the enumerations. static_asserts |
| 196 // checking this are in web/WebInputEventConversion.cpp. | 203 // checking this are in web/WebInputEventConversion.cpp. |
| 197 enum DispatchType { | 204 enum DispatchType { |
| 198 // Event can be canceled. | 205 // Event can be canceled. |
| 199 Blocking, | 206 Blocking, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 WebKeyboardEvent() | 334 WebKeyboardEvent() |
| 328 : WebInputEvent(sizeof(WebKeyboardEvent)) | 335 : WebInputEvent(sizeof(WebKeyboardEvent)) |
| 329 , windowsKeyCode(0) | 336 , windowsKeyCode(0) |
| 330 , nativeKeyCode(0) | 337 , nativeKeyCode(0) |
| 331 , isSystemKey(false) | 338 , isSystemKey(false) |
| 332 , isBrowserShortcut(false) | 339 , isBrowserShortcut(false) |
| 333 { | 340 { |
| 334 memset(&text, 0, sizeof(text)); | 341 memset(&text, 0, sizeof(text)); |
| 335 memset(&unmodifiedText, 0, sizeof(unmodifiedText)); | 342 memset(&unmodifiedText, 0, sizeof(unmodifiedText)); |
| 336 } | 343 } |
| 344 |
| 345 // Please refer to bug http://b/issue?id=961192, which talks about Webkit |
| 346 // keyboard event handling changes. It also mentions the list of keys |
| 347 // which don't have associated character events. |
| 348 bool isCharacterKey() const |
| 349 { |
| 350 #if 0 |
| 351 switch (windowsKeyCode) { |
| 352 case VKEY_BACK: |
| 353 case VKEY_ESCAPE: |
| 354 return false; |
| 355 } |
| 356 #endif |
| 357 return true; |
| 358 } |
| 337 }; | 359 }; |
| 338 | 360 |
| 339 // WebMouseEvent -------------------------------------------------------------- | 361 // WebMouseEvent -------------------------------------------------------------- |
| 340 | 362 |
| 341 class WebMouseEvent : public WebInputEvent, public WebPointerProperties { | 363 class WebMouseEvent : public WebInputEvent, public WebPointerProperties { |
| 342 public: | 364 public: |
| 343 // Renderer coordinates. Similar to viewport coordinates but without | 365 // Renderer coordinates. Similar to viewport coordinates but without |
| 344 // DevTools emulation transform or overscroll applied. i.e. the coordinates | 366 // DevTools emulation transform or overscroll applied. i.e. the coordinates |
| 345 // in Chromium's RenderView bounds. | 367 // in Chromium's RenderView bounds. |
| 346 int x; | 368 int x; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 , uniqueTouchEventId(0) | 665 , uniqueTouchEventId(0) |
| 644 { | 666 { |
| 645 } | 667 } |
| 646 }; | 668 }; |
| 647 | 669 |
| 648 #pragma pack(pop) | 670 #pragma pack(pop) |
| 649 | 671 |
| 650 } // namespace blink | 672 } // namespace blink |
| 651 | 673 |
| 652 #endif | 674 #endif |
| OLD | NEW |