2 * Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
61 var isMac = (navigator.appVersion.indexOf("Mac") != -1);
63 function keyEventToString(evt) {
66 tokens.push('Control');
69 tokens.push(isMac ? 'Option' : 'Alt');
72 tokens.push(isMac ? 'Command' : 'Meta');
77 if (evt.keyCode >= 48 && evt.keyCode <= 90) {
78 tokens.push(String.fromCharCode(evt.keyCode));
79 } else if (KEY_MAP[evt.keyCode]) {
80 tokens.push(KEY_MAP[evt.keyCode]);
84 return tokens.join('+');
87 function getDefaultKeyString() {
88 return keyEventToString({