From d92505e1c93b91453e1fbc7029b0a9cc410f2099 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sun, 17 Mar 2013 15:25:05 +0400 Subject: [PATCH] autodetect platform in HashHandler --- lib/ace/keyboard/hash_handler.js | 3 ++- lib/ace/lib/keys.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ace/keyboard/hash_handler.js b/lib/ace/keyboard/hash_handler.js index fc323837..2ef110da 100644 --- a/lib/ace/keyboard/hash_handler.js +++ b/lib/ace/keyboard/hash_handler.js @@ -32,9 +32,10 @@ define(function(require, exports, module) { "use strict"; var keyUtil = require("../lib/keys"); +var useragent = require("../lib/useragent"); function HashHandler(config, platform) { - this.platform = platform; + this.platform = platform || (useragent.isMac ? "mac" : "win"); this.commands = {}; this.commmandKeyBinding = {}; diff --git a/lib/ace/lib/keys.js b/lib/ace/lib/keys.js index 9743ef88..77399242 100644 --- a/lib/ace/lib/keys.js +++ b/lib/ace/lib/keys.js @@ -47,7 +47,7 @@ var Keys = (function() { KEY_MODS: { "ctrl": 1, "alt": 2, "option" : 2, - "shift": 4, "meta": 8, "command": 8 + "shift": 4, "meta": 8, "command": 8, "cmd": 8 }, FUNCTION_KEYS : {