demos/lib/keymaster.js
function unbindKey(key, scope) {
    var multipleKeys, keys,
      mods = [],
      i, j, obj;

    multipleKeys = getKeys(key);

    for (j = 0; j < multipleKeys.length; j++) {
      keys = multipleKeys[j].split('+');

      if (keys.length > 1) {
        mods = getMods(keys);
        key = keys[keys.length - 1];
      }

      key = code(key);

      if (scope === undefined) {
        scope = getScope();
      }
      if (!_handlers[key]) {
        return;
      }
      for (i = 0; i < _handlers[key].length; i++) {
        obj = _handlers[key][i];
        // only clear handlers if correct scope and mods match
        if (obj.scope === scope && compareArray(obj.mods, mods)) {
          _handlers[key][i] = {};
        }
      }
    }
  }
function unbindKey(key, scope) {
    var multipleKeys, keys,
      mods = [],
      i, j, obj;

    multipleKeys = getKeys(key);

    for (j = 0; j < multipleKeys.length; j++) {
      keys = multipleKeys[j].split('+');

      if (keys.length > 1) {
        mods = getMods(keys);
        key = keys[keys.length - 1];
      }

      key = code(key);

      if (scope === undefined) {
        scope = getScope();
      }
      if (!_handlers[key]) {
        return;
      }
      for (i = 0; i < _handlers[key].length; i++) {
        obj = _handlers[key][i];
        // only clear handlers if correct scope and mods match
        if (obj.scope === scope && compareArray(obj.mods, mods)) {
          _handlers[key][i] = {};
        }
      }
    }
  }
function unbindKey ( key , scope ) { var multipleKeys , keys , mods = [ ] , i , j , obj ; multipleKeys = getKeys ( key ) ; for ( j = 0 ; j < multipleKeys . length ; j ++ ) { keys = multipleKeys [ j ] . split ( '+' ) ; if ( keys . length > 1 ) { mods = getMods ( keys ) ; key = keys [ keys . length - 1 ] ; } key = code ( key ) ; if ( scope === undefined ) { scope = getScope ( ) ; } if ( ! _handlers [ key ] ) { return ; } for ( i = 0 ; i < _handlers [ key ] . length ; i ++ ) { obj = _handlers [ key ] [ i ] ; // only clear handlers if correct scope and mods match if ( obj . scope === scope && compareArray ( obj . mods , mods ) ) { _handlers [ key ] [ i ] = { } ; } } } }
unbind all handlers for given key in current scope
unbind all handlers for given key in current scope