修改路径:android-8.1\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
将 :
<bool name="def_show_ime_with_hard_keyboard">false</bool>
改成 :true
<!-- Default for Settings.Secure.MULTI_PRESS_TIMEOUT --> <integer name="def_multi_press_timeout_millis">300</integer> <!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD --> - <bool name="def_show_ime_with_hard_keyboard">false</bool> + <bool name="def_show_ime_with_hard_keyboard">true</bool> <!-- Default for Settings.System.POINTER_SPEED --> <integer name="def_pointer_speed">0</integer> <!-- Default for DTMF tones enabled --> <bool name="def_dtmf_tones_enabled">true</bool> <!-- Default for UI touch sounds enabled -->
命令:
settings put secure show_ime_with_hard_keyboard 1 打开 settings put secure show_ime_with_hard_keyboard 0 关闭
frameworks\base\core\java\android\provider\Settings.java
public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard";
public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; @Override public boolean isChecked() { return Settings.Secure.getInt(mContext.getContentResolver(), SHOW_IME_WITH_HARD_KEYBOARD , 1)==1; } @Override public boolean setChecked(boolean isChecked) { Settings.Secure.putInt(mContext.getContentResolver(), SHOW_IME_WITH_HARD_KEYBOARD , isChecked ? 1 : 0); return true; }