| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // key enum are defined in ui/events/keycodes/dom3/dom_key_data.h | 276 // key enum are defined in ui/events/keycodes/dom3/dom_key_data.h |
| 277 int domKey; | 277 int domKey; |
| 278 | 278 |
| 279 // This identifies whether this event was tagged by the system as being | 279 // This identifies whether this event was tagged by the system as being |
| 280 // a "system key" event (see | 280 // a "system key" event (see |
| 281 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for | 281 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for |
| 282 // details). Other platforms don't have this concept, but it's just | 282 // details). Other platforms don't have this concept, but it's just |
| 283 // easier to leave it always false than ifdef. | 283 // easier to leave it always false than ifdef. |
| 284 bool isSystemKey; | 284 bool isSystemKey; |
| 285 | 285 |
| 286 // Whether the event forms part of a browser-handled keyboard shortcut. |
| 287 // This can be used to conditionally suppress Char events after a |
| 288 // shortcut-triggering RawKeyDown goes unhandled. |
| 289 bool isBrowserShortcut; |
| 290 |
| 286 // |text| is the text generated by this keystroke. |unmodifiedText| is | 291 // |text| is the text generated by this keystroke. |unmodifiedText| is |
| 287 // |text|, but unmodified by an concurrently-held modifiers (except | 292 // |text|, but unmodified by an concurrently-held modifiers (except |
| 288 // shift). This is useful for working out shortcut keys. Linux and | 293 // shift). This is useful for working out shortcut keys. Linux and |
| 289 // Windows guarantee one character per event. The Mac does not, but in | 294 // Windows guarantee one character per event. The Mac does not, but in |
| 290 // reality that's all it ever gives. We're generous, and cap it a bit | 295 // reality that's all it ever gives. We're generous, and cap it a bit |
| 291 // longer. | 296 // longer. |
| 292 WebUChar text[textLengthCap]; | 297 WebUChar text[textLengthCap]; |
| 293 WebUChar unmodifiedText[textLengthCap]; | 298 WebUChar unmodifiedText[textLengthCap]; |
| 294 | 299 |
| 295 // This is a string identifying the key pressed. | 300 // This is a string identifying the key pressed. |
| 296 char keyIdentifier[keyIdentifierLengthCap]; | 301 char keyIdentifier[keyIdentifierLengthCap]; |
| 297 | 302 |
| 298 WebKeyboardEvent() | 303 WebKeyboardEvent() |
| 299 : WebInputEvent(sizeof(WebKeyboardEvent)) | 304 : WebInputEvent(sizeof(WebKeyboardEvent)) |
| 300 , windowsKeyCode(0) | 305 , windowsKeyCode(0) |
| 301 , nativeKeyCode(0) | 306 , nativeKeyCode(0) |
| 302 , isSystemKey(false) | 307 , isSystemKey(false) |
| 308 , isBrowserShortcut(false) |
| 303 { | 309 { |
| 304 memset(&text, 0, sizeof(text)); | 310 memset(&text, 0, sizeof(text)); |
| 305 memset(&unmodifiedText, 0, sizeof(unmodifiedText)); | 311 memset(&unmodifiedText, 0, sizeof(unmodifiedText)); |
| 306 memset(&keyIdentifier, 0, sizeof(keyIdentifier)); | 312 memset(&keyIdentifier, 0, sizeof(keyIdentifier)); |
| 307 } | 313 } |
| 308 | 314 |
| 309 // Sets keyIdentifier based on the value of windowsKeyCode. This is | 315 // Sets keyIdentifier based on the value of windowsKeyCode. This is |
| 310 // handy for generating synthetic keyboard events. | 316 // handy for generating synthetic keyboard events. |
| 311 BLINK_EXPORT void setKeyIdentifierFromWindowsKeyCode(); | 317 BLINK_EXPORT void setKeyIdentifierFromWindowsKeyCode(); |
| 312 }; | 318 }; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 , uniqueTouchEventId(0) | 587 , uniqueTouchEventId(0) |
| 582 { | 588 { |
| 583 } | 589 } |
| 584 }; | 590 }; |
| 585 | 591 |
| 586 #pragma pack(pop) | 592 #pragma pack(pop) |
| 587 | 593 |
| 588 } // namespace blink | 594 } // namespace blink |
| 589 | 595 |
| 590 #endif | 596 #endif |
| OLD | NEW |