mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
Don't treat ctrl-click as a right-click except on Mac.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
goog.provide('Blockly.utils');
|
||||
|
||||
goog.require('goog.events.BrowserFeature');
|
||||
goog.require('goog.userAgent');
|
||||
|
||||
|
||||
/**
|
||||
@@ -324,8 +325,12 @@ Blockly.createSvgElement = function(name, attrs, opt_parent) {
|
||||
* @return {boolean} True if right-click.
|
||||
*/
|
||||
Blockly.isRightButton = function(e) {
|
||||
// Control-clicking in WebKit on Mac OS X fails to change button to 2.
|
||||
return e.button == 2 || e.ctrlKey;
|
||||
if (e.ctrlKey && goog.userAgent.MAC) {
|
||||
// Control-clicking on Mac OS X is treated as a right-click.
|
||||
// WebKit on Mac OS X fails to change button to 2 (but Gecko does).
|
||||
return true;
|
||||
}
|
||||
return e.button == 2;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user