B2G/gaia/apps/keyboard/js/keyboard.js
// the input field type, its inputmode, its content, and the cursor position.
the input field type, its inputmode, its content, and the cursor position.
the input field type its inputmode its content and the cursor position .
function showKeyboard(state) {
  var newKeyboardName = currentKeyboardName;
  if (keyboardName !== currentKeyboardName) {
    if (enabledKeyboardNames.indexOf(currentKeyboardName) == -1) {
      navigator.mozSettings.createLock().set({
        'keyboard.current': enabledKeyboardNames[0]
      });
      newKeyboardName = enabledKeyboardNames[0];
    }
    setKeyboardName(newKeyboardName);
  }
  IMERender.showIME();
  currentInputMode = state.inputmode;
  currentInputType = mapInputType(state.type);
  resetKeyboard();
  if (inputMethod.activate) {
    inputMethod.activate(Keyboards[keyboardName].autoCorrectLanguage, state, {
      suggest: suggestionsEnabled,
      correct: correctionsEnabled
    });
  }
  renderKeyboard(keyboardName);
}
function showKeyboard ( state ) { var newKeyboardName = currentKeyboardName ; if ( keyboardName !== currentKeyboardName ) { if ( enabledKeyboardNames . indexOf ( currentKeyboardName ) == - 1 ) { navigator . mozSettings . createLock ( ) . set ( { 'keyboard.current' : enabledKeyboardNames [ 0 ] } ) ; newKeyboardName = enabledKeyboardNames [ 0 ] ; } setKeyboardName ( newKeyboardName ) ; } IMERender . showIME ( ) ; currentInputMode = state . inputmode ; currentInputType = mapInputType ( state . type ) ; resetKeyboard ( ) ; if ( inputMethod . activate ) { inputMethod . activate ( Keyboards [ keyboardName ] . autoCorrectLanguage , state , { suggest : suggestionsEnabled , correct : correctionsEnabled } ) ; } renderKeyboard ( keyboardName ) ; }
the input field type, its inputmode, its content, and the cursor position.
the input field type its inputmode its content and the cursor position .
// If the keyboard is not initialized or the layout has changed, // set the new keyboard // Make sure that currentKeyboardName is enabled. If not, use // the first enabled keyboard as the default. // Update the keyboard.current setting with the first enabled keyboard // Now initialize that keyboard // render the keyboard after activation, which will determine the state // of uppercase/suggestion, etc.