| 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) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
| 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 22 matching lines...) Expand all Loading... |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 // | 35 // |
| 36 // The below code was adapted from the WebKit file webview.cpp | 36 // The below code was adapted from the WebKit file webview.cpp |
| 37 // | 37 // |
| 38 | 38 |
| 39 static const unsigned CtrlKey = 1 << 0; | 39 static const unsigned CtrlKey = 1 << 0; |
| 40 static const unsigned AltKey = 1 << 1; | 40 static const unsigned AltKey = 1 << 1; |
| 41 static const unsigned ShiftKey = 1 << 2; | 41 static const unsigned ShiftKey = 1 << 2; |
| 42 static const unsigned MetaKey = 1 << 3; | 42 static const unsigned MetaKey = 1 << 3; |
| 43 #if OS(MACOSX) && !OS(IOS) | |
| 44 // Aliases for the generic key defintions to make kbd shortcuts definitions more | |
| 45 // readable on OS X. | |
| 46 static const unsigned OptionKey = AltKey; | |
| 47 | |
| 48 // Do not use this constant for anything but cursor movement commands. Keys | |
| 49 // with cmd set have their |isSystemKey| bit set, so chances are the shortcut | |
| 50 // will not be executed. Another, less important, reason is that shortcuts | |
| 51 // defined in the renderer do not blink the menu item that they triggered. See | |
| 52 // http://crbug.com/25856 and the bugs linked from there for details. | |
| 53 static const unsigned CommandKey = MetaKey; | |
| 54 #endif | |
| 55 | 43 |
| 56 // Keys with special meaning. These will be delegated to the editor using | 44 // Keys with special meaning. These will be delegated to the editor using |
| 57 // the execCommand() method | 45 // the execCommand() method |
| 58 struct KeyDownEntry { | 46 struct KeyDownEntry { |
| 59 unsigned virtualKey; | 47 unsigned virtualKey; |
| 60 unsigned modifiers; | 48 unsigned modifiers; |
| 61 const char* name; | 49 const char* name; |
| 62 }; | 50 }; |
| 63 | 51 |
| 64 struct KeyPressEntry { | 52 struct KeyPressEntry { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (event.metaKey()) | 176 if (event.metaKey()) |
| 189 return false; | 177 return false; |
| 190 #endif | 178 #endif |
| 191 } | 179 } |
| 192 #endif | 180 #endif |
| 193 | 181 |
| 194 return true; | 182 return true; |
| 195 } | 183 } |
| 196 } // namespace blink | 184 } // namespace blink |
| 197 | 185 |
| OLD | NEW |