diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml index e3f0aeaded35da43773948f0fd64c7b557f0709e..49bfe65c9335517af1f05132fba6afe05fd312d7 100644 --- a/java/res/values/donottranslate.xml +++ b/java/res/values/donottranslate.xml @@ -22,10 +22,11 @@ See {@link SettingsValues#needsToShowVoiceInputKey(SharedPreferences,Resources)} --> <string name="voice_mode_main">0</string> - <!-- Title for Latin keyboard debug settings activity / dialog --> - <string name="english_ime_debug_settings">Android keyboard Debug settings</string> + <!-- Title for Android keyboard debug settings activity / dialog --> + <string name="english_ime_debug_settings">Android Keyboard Debug settings</string> <string name="prefs_debug_mode">Debug Mode</string> <string name="prefs_force_non_distinct_multitouch">Force non-distinct multitouch</string> + <string name="prefs_force_physical_keyboard_special_key">Force physical keyboard special key</string> <!-- Subtype locale display name exceptions. For each exception, there should be related string resources for display name that may have diff --git a/java/res/xml/prefs_screen_debug.xml b/java/res/xml/prefs_screen_debug.xml index ae29a8a82e1c57ef3c1e5536bf1f4f8b82169303..0acc69a1681b4657fe1fdafa2c4e10dc354c11e4 100644 --- a/java/res/xml/prefs_screen_debug.xml +++ b/java/res/xml/prefs_screen_debug.xml @@ -30,6 +30,11 @@ android:title="@string/prefs_force_non_distinct_multitouch" android:defaultValue="false" android:persistent="true" /> + <CheckBoxPreference + android:key="force_physical_keyboard_special_key" + android:title="@string/prefs_force_physical_keyboard_special_key" + android:defaultValue="false" + android:persistent="true" /> <CheckBoxPreference android:key="pref_sliding_key_input_preview" android:title="@string/sliding_key_input_preview" diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 9b629ca147818d6a98375c0954e20e0157829e9c..91b01b506e6ab50472fef6de7887fdf018f38e91 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -155,7 +155,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @UsedForTesting final KeyboardSwitcher mKeyboardSwitcher; private final SubtypeSwitcher mSubtypeSwitcher; private final SubtypeState mSubtypeState = new SubtypeState(); - private final SpecialKeyDetector mSpecialKeyDetector = new SpecialKeyDetector(); + private final SpecialKeyDetector mSpecialKeyDetector; // Object for reacting to adding/removing a dictionary pack. private final BroadcastReceiver mDictionaryPackInstallReceiver = @@ -517,6 +517,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mSettings = Settings.getInstance(); mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance(); + mSpecialKeyDetector = new SpecialKeyDetector(this); mIsHardwareAcceleratedDrawingEnabled = InputMethodServiceCompatUtils.enableHardwareAcceleration(this); Log.i(TAG, "Hardware accelerated drawing: " + mIsHardwareAcceleratedDrawingEnabled); diff --git a/java/src/com/android/inputmethod/latin/SpecialKeyDetector.java b/java/src/com/android/inputmethod/latin/SpecialKeyDetector.java index 9d6c69ae778cc9e943e0d1ddcd1b2558c3fa4ea1..27b2f501222555f66287b1785f68eea54e148163 100644 --- a/java/src/com/android/inputmethod/latin/SpecialKeyDetector.java +++ b/java/src/com/android/inputmethod/latin/SpecialKeyDetector.java @@ -16,9 +16,17 @@ package com.android.inputmethod.latin; +import android.content.Context; import android.view.KeyEvent; final class SpecialKeyDetector { + /** + * Special physical key detector + * @param context a context of this detector. + */ + public SpecialKeyDetector(final Context context) { + } + /** * Record a down key event. * @param keyEvent a down key event. diff --git a/java/src/com/android/inputmethod/latin/settings/DebugSettings.java b/java/src/com/android/inputmethod/latin/settings/DebugSettings.java index dce11b434e01f0fcda79b54c0e7435d7d417091f..bb3749da40de2f27ced3e258a6d5d395b5d3806a 100644 --- a/java/src/com/android/inputmethod/latin/settings/DebugSettings.java +++ b/java/src/com/android/inputmethod/latin/settings/DebugSettings.java @@ -19,6 +19,8 @@ package com.android.inputmethod.latin.settings; public final class DebugSettings { public static final String PREF_DEBUG_MODE = "debug_mode"; public static final String PREF_FORCE_NON_DISTINCT_MULTITOUCH = "force_non_distinct_multitouch"; + public static final String PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY = + "force_physical_keyboard_special_key"; public static final String PREF_KEY_PREVIEW_SHOW_UP_START_SCALE = "pref_key_preview_show_up_start_scale"; public static final String PREF_KEY_PREVIEW_DISMISS_END_SCALE = diff --git a/java/src/com/android/inputmethod/latin/settings/DebugSettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/DebugSettingsFragment.java index 4e41d52a3f9cd23bb8efb2f662347fe6db7cf583..2139bb11cd0e40d2df8a8de39e8bb686b5c779c2 100644 --- a/java/src/com/android/inputmethod/latin/settings/DebugSettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/settings/DebugSettingsFragment.java @@ -133,7 +133,8 @@ public final class DebugSettingsFragment extends SubScreenFragment mServiceNeedsRestart = true; return; } - if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH)) { + if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH) + || key.equals(DebugSettings.PREF_FORCE_PHYSICAL_KEYBOARD_SPECIAL_KEY)) { mServiceNeedsRestart = true; return; }