unsetMouseAction method

dynamic unsetMouseAction(
  1. dynamic mouse, [
  2. dynamic key = null
])
  • Remove a mouse action by specifying its mouse/key combination
    • @param {*} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
      • @param {*} key The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed
      • @returns {Boolean} True if the operation has been succesfully removed, false otherwise

Implementation

unsetMouseAction(mouse, [key = null]) {
  for (var i = 0; i < this.mouseActions.length; i++) {
    if (this.mouseActions[i]['mouse'] == mouse &&
        this.mouseActions[i]['key'] == key) {
      this.mouseActions.splice(i, 1);
      return true;
    }
  }

  return false;
}