getOpFromAction method
dynamic
getOpFromAction(
- dynamic mouse,
- dynamic key
- Return the operation associated to a mouse/keyboard 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 The operation if it has been found, null otherwise
- @param {*} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
Implementation
getOpFromAction(mouse, key) {
var action;
for (var i = 0; i < this.mouseActions.length; i++) {
action = this.mouseActions[i];
if (action['mouse'] == mouse && action['key'] == key) {
return action['operation'];
}
}
if (key != null) {
for (var i = 0; i < this.mouseActions.length; i++) {
action = this.mouseActions[i];
if (action['mouse'] == mouse && action['key'] == null) {
return action['operation'];
}
}
}
return null;
}