Browse Source

fixes #868

Nicolas Petton 10 years ago
parent
commit
94286a8243
2 changed files with 23 additions and 13 deletions
  1. 16 7
      src/Helios-KeyBindings.js
  2. 7 6
      src/Helios-KeyBindings.st

+ 16 - 7
src/Helios-KeyBindings.js

@@ -1240,29 +1240,38 @@ protocol: 'events',
 fn: function (event){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4;
+var $3,$2,$6,$5,$4,$1,$7;
 $3=_st(event)._which();
 $ctx1.sendIdx["which"]=1;
 $2=_st($3).__eq(self._escapeKey());
 $ctx1.sendIdx["="]=1;
 $1=_st($2)._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(event)._which()).__eq((71)))._and_((function(){
+$6=_st(event)._which();
+$ctx2.sendIdx["which"]=2;
+$5=_st($6).__eq((71));
+$ctx2.sendIdx["="]=2;
+$4=_st($5)._or_((function(){
 return smalltalk.withContext(function($ctx3) {
-return _st(event)._ctrlKey();
+return _st(_st(event)._which()).__eq(self._activationKey());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+return _st($4)._and_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(event)._ctrlKey();
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+$ctx1.sendIdx["or:"]=1;
 if(smalltalk.assert($1)){
 self._deactivate();
 _st(event)._preventDefault();
 return false;
 };
-$4=self._handleBindingFor_(event);
-return $4;
+$7=self._handleBindingFor_(event);
+return $7;
 }, function($ctx1) {$ctx1.fill(self,"handleActiveKeyDown:",{event:event},globals.HLKeyBinder)})},
 args: ["event"],
-source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC or ctrl+g deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09event which = 71 and: [ event ctrlKey ] ])\x0a        \x09ifTrue: [ \x0a            \x09self deactivate.\x0a\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09^ false ].\x0a            \x0a    \x22Handle the keybinding\x22\x0a    ^ self handleBindingFor: event",
-messageSends: ["ifTrue:", "or:", "=", "which", "escapeKey", "and:", "ctrlKey", "deactivate", "preventDefault", "handleBindingFor:"],
+source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC, ctrl+g ctrl+space deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09(event which = 71 or: [ event which = self activationKey ]) \x0a\x09\x09\x09and: [ event ctrlKey ] ])\x0a        \x09\x09ifTrue: [ \x0a           \x09\x09\x09self deactivate.\x0a\x09\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09\x09^ false ].\x0a            \x0a    \x22Handle the keybinding\x22\x0a    ^ self handleBindingFor: event",
+messageSends: ["ifTrue:", "or:", "=", "which", "escapeKey", "and:", "activationKey", "ctrlKey", "deactivate", "preventDefault", "handleBindingFor:"],
 referencedClasses: []
 }),
 globals.HLKeyBinder);

+ 7 - 6
src/Helios-KeyBindings.st

@@ -429,13 +429,14 @@ defaultBindings
 
 handleActiveKeyDown: event
 
-	"ESC or ctrl+g deactivate the keyBinder"
+	"ESC, ctrl+g ctrl+space deactivate the keyBinder"
 	(event which = self escapeKey or: [
-		event which = 71 and: [ event ctrlKey ] ])
-        	ifTrue: [ 
-            	self deactivate.
-				event preventDefault.
-				^ false ].
+		(event which = 71 or: [ event which = self activationKey ]) 
+			and: [ event ctrlKey ] ])
+        		ifTrue: [ 
+           			self deactivate.
+					event preventDefault.
+					^ false ].
             
     "Handle the keybinding"
     ^ self handleBindingFor: event