| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 entry.name); | 220 entry.name); |
| 221 } | 221 } |
| 222 | 222 |
| 223 for (const auto& entry : kKeyboardCodeKeyPressEntries) { | 223 for (const auto& entry : kKeyboardCodeKeyPressEntries) { |
| 224 keyPressCommandsMap->set(entry.modifiers << 16 | entry.charCode, | 224 keyPressCommandsMap->set(entry.modifiers << 16 | entry.charCode, |
| 225 entry.name); | 225 entry.name); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 unsigned modifiers = | 229 unsigned modifiers = |
| 230 keyEvent->modifiers & (ShiftKey | AltKey | CtrlKey | MetaKey); | 230 keyEvent->modifiers() & (ShiftKey | AltKey | CtrlKey | MetaKey); |
| 231 | 231 |
| 232 if (keyEvent->type == WebInputEvent::RawKeyDown) { | 232 if (keyEvent->type() == WebInputEvent::RawKeyDown) { |
| 233 int mapKey = modifiers << 16 | event.keyCode(); | 233 int mapKey = modifiers << 16 | event.keyCode(); |
| 234 const char* name = mapKey ? keyDownCommandsMap->get(mapKey) : nullptr; | 234 const char* name = mapKey ? keyDownCommandsMap->get(mapKey) : nullptr; |
| 235 if (!name) | 235 if (!name) |
| 236 name = lookupCommandNameFromDomKeyKeyDown(event.key(), modifiers); | 236 name = lookupCommandNameFromDomKeyKeyDown(event.key(), modifiers); |
| 237 return name; | 237 return name; |
| 238 } | 238 } |
| 239 | 239 |
| 240 int mapKey = modifiers << 16 | event.charCode(); | 240 int mapKey = modifiers << 16 | event.charCode(); |
| 241 return mapKey ? keyPressCommandsMap->get(mapKey) : 0; | 241 return mapKey ? keyPressCommandsMap->get(mapKey) : 0; |
| 242 } | 242 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 #if OS(MACOSX) | 282 #if OS(MACOSX) |
| 283 if (event.metaKey()) | 283 if (event.metaKey()) |
| 284 return false; | 284 return false; |
| 285 #endif | 285 #endif |
| 286 } | 286 } |
| 287 #endif | 287 #endif |
| 288 | 288 |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 } // namespace blink | 291 } // namespace blink |
| OLD | NEW |