Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: ui/file_manager/audio_player/js/audio_player.js

Issue 1994563002: Remove the use of KeyEvent.keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/audio_player/js/audio_player.js
diff --git a/ui/file_manager/audio_player/js/audio_player.js b/ui/file_manager/audio_player/js/audio_player.js
index cb05f2eb8c1abac190ad661b427dd5df1802236b..37921756298226caa7dda29c35c0cdb3214be925 100644
--- a/ui/file_manager/audio_player/js/audio_player.js
+++ b/ui/file_manager/audio_player/js/audio_player.js
@@ -350,43 +350,43 @@ AudioPlayer.prototype.onResize_ = function(event) {
* @private
*/
AudioPlayer.prototype.onKeyDown_ = function(event) {
- switch (util.getKeyModifiers(event) + event.keyIdentifier) {
- case 'Ctrl-U+0057': // Ctrl+W => Close the player.
+ switch (util.getKeyModifiers(event) + event.key) {
+ case 'Ctrl-w': // Ctrl+W => Close the player.
chrome.app.window.current().close();
break;
// Handle debug shortcut keys.
- case 'Ctrl-Shift-U+0049': // Ctrl+Shift+I
+ case 'Ctrl-Shift-I': // Ctrl+Shift+I
chrome.fileManagerPrivate.openInspector('normal');
break;
- case 'Ctrl-Shift-U+004A': // Ctrl+Shift+J
+ case 'Ctrl-Shift-J': // Ctrl+Shift+J
chrome.fileManagerPrivate.openInspector('console');
break;
- case 'Ctrl-Shift-U+0043': // Ctrl+Shift+C
+ case 'Ctrl-Shift-C': // Ctrl+Shift+C
chrome.fileManagerPrivate.openInspector('element');
break;
- case 'Ctrl-Shift-U+0042': // Ctrl+Shift+B
+ case 'Ctrl-Shift-B': // Ctrl+Shift+B
chrome.fileManagerPrivate.openInspector('background');
break;
- case 'U+0020': // Space
- case 'U+004B': // K
+ case ' ': // Space
+ case 'k':
this.player_.dispatchEvent(new Event('toggle-pause-event'));
break;
- case 'Up':
- case 'Right':
+ case 'ArrowUp':
+ case 'ArrowRight':
if (event.target.id !== 'volumeSlider')
this.player_.dispatchEvent(new Event('small-forward-skip-event'));
break;
- case 'Down':
- case 'Left':
+ case 'ArrowDown':
+ case 'ArrowLeft':
if (event.target.id !== 'volumeSlider')
this.player_.dispatchEvent(new Event('small-backword-skip-event'));
break;
- case 'U+004C': // L
+ case 'l':
this.player_.dispatchEvent(new Event('big-forward-skip-event'));
break;
- case 'U+004A': // J
+ case 'j':
this.player_.dispatchEvent(new Event('big-backword-skip-event'));
break;
}

Powered by Google App Engine
This is Rietveld 408576698