Ctrl Key

44 views
Skip to first unread message

Adilson Vahldick

unread,
Feb 23, 2015, 10:20:26 AM2/23/15
to blo...@googlegroups.com
If I click on the block with the ctrl key together, Blockly tries to show the context menu. This behavious happens because the condition in the method below:

Blockly.isRightButton = function(e) {
  // Control-clicking in WebKit on Mac OS X fails to change button to 2.
  return e.button == 2 || e.ctrlKey;
};


I want to code a multiple blocks selection and afterwards Ctrl+C and Ctrl+V. Generally, the programs use the Ctrl key to select separate objects, and because this I also want to do the same feature.

Really, that is no matter to solve this right button problem with WebKit on Mac OS X ?

Adilson

Neil Fraser

unread,
Feb 23, 2015, 2:34:55 PM2/23/15
to blo...@googlegroups.com
The catch is that on a Mac, Ctrl-left-click should normally be treated as a right-click (since Macs traditionally had one-button mice).  On a Mac the Command key is used to perform multiple selections (e.metaKey).

I'll modify the isRightButton function to only treat Ctrl-left-click as a right-click if goog.userAgent.MAC is true.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages