function modifyLayoutAndKeyData(newLayoutData, newKeyData, keyIdsToRemove) {
  var layout = getLayout();
  var indicesToRemove = [];
  for (var i = 0; i < layout.length; i++) {
    var keyId = layout[i][0];
    if (keyId in newLayoutData) {
      layout[i] = [keyId].concat(newLayoutData[keyId]);
      delete newLayoutData[keyId];
    }

    if (keyIdsToRemove.includes(keyId))
      indicesToRemove.push(i);
  }

  // Remove the desired keys.
  for (var i in indicesToRemove)
    layout.splice(indicesToRemove[i], 1);

  // Add the new ones.
  for (var keyId in newLayoutData)
    layout.push([keyId].concat(newLayoutData[keyId]));

  // Update the new key data.
  var keyData = getKeyboardGlyphData()['keys'];
  for (var keyId in newKeyData)
    keyData[keyId] = newKeyData[keyId];
}
/**
 * Modifies the current layout based on the given parameters.
 *
 * @param {Object<string, Array<number>>} newLayoutData The new or updated key
 * layout positions and sizes. The keys are the key IDs, and the values are
 * bounds of the corresponding keys.
 * @param {Object<string, Object<string, string>>} newKeyData The updated key
 * data such as labels and formats. The keys are the key IDs, and the values
 * are the key data.
 * @param {Array<string>} keyIdsToRemove The key IDs to remove from the
 * current layout.
 */
Modifies the current layout based on the given parameters.
@param {Object>} newLayoutData The new or updated key
layout positions and sizes. The keys are the key IDs, and the values are
bounds of the corresponding keys.
@param {Object>} newKeyData The updated key
data such as labels and formats. The keys are the key IDs, and the values
are the key data.
@param {Array} keyIdsToRemove The key IDs to remove from the
current layout.
Modifies the current layout based on the given parameters . @param { Object > } newLayoutData The new or updated key layout positions and sizes . The keys are the key IDs and the values are bounds of the corresponding keys . @param { Object > } newKeyData The updated key data such as labels and formats . The keys are the key IDs and the values are the key data . @param { Array } keyIdsToRemove The key IDs to remove from the current layout .
function modifyLayoutAndKeyData(newLayoutData, newKeyData, keyIdsToRemove) {
  var layout = getLayout();
  var indicesToRemove = [];
  for (var i = 0; i < layout.length; i++) {
    var keyId = layout[i][0];
    if (keyId in newLayoutData) {
      layout[i] = [keyId].concat(newLayoutData[keyId]);
      delete newLayoutData[keyId];
    }
    if (keyIdsToRemove.includes(keyId))
      indicesToRemove.push(i);
  }
  for (var i in indicesToRemove)
    layout.splice(indicesToRemove[i], 1);
  for (var keyId in newLayoutData)
    layout.push([keyId].concat(newLayoutData[keyId]));
  var keyData = getKeyboardGlyphData()['keys'];
  for (var keyId in newKeyData)
    keyData[keyId] = newKeyData[keyId];
}
function modifyLayoutAndKeyData ( newLayoutData , newKeyData , keyIdsToRemove ) { var layout = getLayout ( ) ; var indicesToRemove = [ ] ; for ( var i = 0 ; i < layout . length ; i ++ ) { var keyId = layout [ i ] [ 0 ] ; if ( keyId in newLayoutData ) { layout [ i ] = [ keyId ] . concat ( newLayoutData [ keyId ] ) ; delete newLayoutData [ keyId ] ; } if ( keyIdsToRemove . includes ( keyId ) ) indicesToRemove . push ( i ) ; } for ( var i in indicesToRemove ) layout . splice ( indicesToRemove [ i ] , 1 ) ; for ( var keyId in newLayoutData ) layout . push ( [ keyId ] . concat ( newLayoutData [ keyId ] ) ) ; var keyData = getKeyboardGlyphData ( ) [ 'keys' ] ; for ( var keyId in newKeyData ) keyData [ keyId ] = newKeyData [ keyId ] ; }
Modifies the current layout based on the given parameters.
Modifies the current layout based on the given parameters .
// Remove the desired keys. // Add the new ones. // Update the new key data.