Browse Source

changed key binding for OS X; now using ctrl-space for commands instead of cmd-space (otherwise OS X will bring up spotlight no matter what)

Sebastian Sastre 11 years ago
parent
commit
d650648567
3 changed files with 30 additions and 44 deletions
  1. 13 19
      js/Helios-KeyBindings.deploy.js
  2. 15 21
      js/Helios-KeyBindings.js
  3. 2 4
      st/Helios-KeyBindings.st

+ 13 - 19
js/Helios-KeyBindings.deploy.js

@@ -472,25 +472,19 @@ smalltalk.addMethod(
 "_handleInactiveKeyDown_",
 smalltalk.method({
 selector: "handleInactiveKeyDown:",
-fn: function (event) {
-    var self = this;
-    var $1, $3, $2;
-    $1 = smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [smalltalk.send(self, "_activationKey", [])]);
-    if (smalltalk.assert($1)) {
-        $3 = smalltalk.send(self, "_systemIsMac", []);
-        if (smalltalk.assert($3)) {
-            $2 = smalltalk.send(event, "_metaKey", []);
-        } else {
-            $2 = smalltalk.send(event, "_ctrlKey", []);
-        }
-        if (smalltalk.assert($2)) {
-            smalltalk.send(self, "_activate", []);
-            smalltalk.send(event, "_preventDefault", []);
-            return false;
-        }
-    }
-    return self;
-}
+fn: function (event){
+var self=this;
+var $1,$2;
+$1=smalltalk.send(smalltalk.send(event,"_which",[]),"__eq",[smalltalk.send(self,"_activationKey",[])]);
+if(smalltalk.assert($1)){
+$2=smalltalk.send(event,"_ctrlKey",[]);
+if(smalltalk.assert($2)){
+smalltalk.send(self,"_activate",[]);
+smalltalk.send(event,"_preventDefault",[]);
+return false;
+};
+};
+return self}
 }),
 smalltalk.HLKeyBinder);
 

+ 15 - 21
js/Helios-KeyBindings.js

@@ -648,28 +648,22 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "handleInactiveKeyDown:",
 category: 'events',
-fn: function (event) {
-    var self = this;
-    var $1, $3, $2;
-    $1 = smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [smalltalk.send(self, "_activationKey", [])]);
-    if (smalltalk.assert($1)) {
-        $3 = smalltalk.send(self, "_systemIsMac", []);
-        if (smalltalk.assert($3)) {
-            $2 = smalltalk.send(event, "_metaKey", []);
-        } else {
-            $2 = smalltalk.send(event, "_ctrlKey", []);
-        }
-        if (smalltalk.assert($2)) {
-            smalltalk.send(self, "_activate", []);
-            smalltalk.send(event, "_preventDefault", []);
-            return false;
-        }
-    }
-    return self;
-},
+fn: function (event){
+var self=this;
+var $1,$2;
+$1=smalltalk.send(smalltalk.send(event,"_which",[]),"__eq",[smalltalk.send(self,"_activationKey",[])]);
+if(smalltalk.assert($1)){
+$2=smalltalk.send(event,"_ctrlKey",[]);
+if(smalltalk.assert($2)){
+smalltalk.send(self,"_activate",[]);
+smalltalk.send(event,"_preventDefault",[]);
+return false;
+};
+};
+return self},
 args: ["event"],
-source: "handleInactiveKeyDown: event\x0a\x09event which = self activationKey ifTrue: [\x0a          (self systemIsMac\x0a                ifTrue: [ event metaKey ]\x0a                  ifFalse: [  event ctrlKey ])  ifTrue: [\x0a\x09\x09\x09\x09\x09self activate. \x0a               \x09\x09 event preventDefault. \x0a                \x09^ false ] ]",
-messageSends: ["ifTrue:", "activate", "preventDefault", "ifTrue:ifFalse:", "metaKey", "ctrlKey", "systemIsMac", "=", "activationKey", "which"],
+source: "handleInactiveKeyDown: event\x0a      event which = self activationKey ifTrue: [\x0a      \x09\x09event ctrlKey  ifTrue: [\x0a\x09\x09\x09\x09\x09self activate. \x0a               \x09\x09 event preventDefault. \x0a                \x09^ false ] ]",
+messageSends: ["ifTrue:", "activate", "preventDefault", "ctrlKey", "=", "activationKey", "which"],
 referencedClasses: []
 }),
 smalltalk.HLKeyBinder);

+ 2 - 4
st/Helios-KeyBindings.st

@@ -228,10 +228,8 @@ handleBindingFor: anEvent
 !
 
 handleInactiveKeyDown: event
-	event which = self activationKey ifTrue: [
-          (self systemIsMac
-                ifTrue: [ event metaKey ]
-                  ifFalse: [  event ctrlKey ])  ifTrue: [
+      event which = self activationKey ifTrue: [
+      		event ctrlKey  ifTrue: [
 					self activate. 
                		 event preventDefault. 
                 	^ false ] ]