Chromium Code Reviews| Index: ui/webui/resources/js/cr/ui/command.js |
| diff --git a/ui/webui/resources/js/cr/ui/command.js b/ui/webui/resources/js/cr/ui/command.js |
| index 8663a373bdf8dd4b440edc2f62918c2ae86ae15f..15f31e6a467fb338b11985817e5e9fc2f4ae6b86 100644 |
| --- a/ui/webui/resources/js/cr/ui/command.js |
| +++ b/ui/webui/resources/js/cr/ui/command.js |
| @@ -26,7 +26,7 @@ cr.define('cr.ui', function() { |
| function KeyboardShortcut(shortcut) { |
| var mods = {}; |
| var ident = ''; |
| - shortcut.split('-').forEach(function(part) { |
| + shortcut.split('|').forEach(function(part) { |
| var partLc = part.toLowerCase(); |
| switch (partLc) { |
| case 'alt': |
| @@ -53,7 +53,7 @@ cr.define('cr.ui', function() { |
| * @return {boolean} Whether we found a match or not. |
| */ |
| matchesEvent: function(e) { |
| - if (e.keyIdentifier == this.ident_) { |
| + if (e.key == this.ident_) { |
| // All keyboard modifiers needs to match. |
| var mods = this.mods_; |
| return ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].every(function(k) { |
| @@ -114,17 +114,17 @@ cr.define('cr.ui', function() { |
| /** |
| * The keyboard shortcut that triggers the command. This is a string |
| - * consisting of a keyIdentifier (as reported by WebKit in keydown) as |
| - * well as optional key modifiers joinded with a '-'. |
| + * consisting of a key (as reported by WebKit in keydown) as |
| + * well as optional key modifiers joinded with a '|'. |
| * |
| * Multiple keyboard shortcuts can be provided by separating them by |
| * whitespace. |
| * |
| * For example: |
| * "F1" |
| - * "U+0008-Meta" for Apple command backspace. |
| - * "U+0041-Ctrl" for Control A |
| - * "U+007F U+0008-Meta" for Delete and Command Backspace |
| + * "Backspace-Meta" for Apple command backspace. |
| + * "a-Ctrl" for Control A |
| + * "Delete Backspace-Meta" for Delete and Command Backspace |
|
Dan Beam
2016/06/29 23:34:17
shouldn't these - be changed to |?
dtapuska
2016/06/30 14:16:50
Done.
|
| * |
| * @type {string} |
| */ |