mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-20 00:40:29 +00:00
Merge pull request #460 from prabhy619/issue455
#455 Disabling long pressing space for keyboard change
This commit is contained in:
commit
9bb92981f2
5 changed files with 13 additions and 1 deletions
|
@ -1082,7 +1082,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int code = key.getCode();
|
final int code = key.getCode();
|
||||||
if (code == Constants.CODE_SPACE || code == Constants.CODE_LANGUAGE_SWITCH) {
|
if (code == Constants.CODE_SPACE&&Settings.getInstance().getCurrent().mSpaceForLangChange || code == Constants.CODE_LANGUAGE_SWITCH) {
|
||||||
// Long pressing the space key invokes IME switcher dialog.
|
// Long pressing the space key invokes IME switcher dialog.
|
||||||
if (sListener.onCustomRequest(Constants.CUSTOM_CODE_SHOW_INPUT_METHOD_PICKER)) {
|
if (sListener.onCustomRequest(Constants.CUSTOM_CODE_SHOW_INPUT_METHOD_PICKER)) {
|
||||||
cancelKeyTracking();
|
cancelKeyTracking();
|
||||||
|
|
|
@ -111,6 +111,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
||||||
|
|
||||||
public static final String PREF_SHOW_HINTS = "pref_show_hints";
|
public static final String PREF_SHOW_HINTS = "pref_show_hints";
|
||||||
|
|
||||||
|
public static final String PREF_SPACE_TO_CHANGE_LANG = "prefs_long_press_keyboard_to_change_lang";
|
||||||
|
|
||||||
// This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead.
|
// This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead.
|
||||||
// This is being used only for the backward compatibility.
|
// This is being used only for the backward compatibility.
|
||||||
private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY =
|
private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY =
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class SettingsValues {
|
||||||
public final boolean mIncludesOtherImesInLanguageSwitchList;
|
public final boolean mIncludesOtherImesInLanguageSwitchList;
|
||||||
public final boolean mShowsNumberRow;
|
public final boolean mShowsNumberRow;
|
||||||
public final boolean mShowsHints;
|
public final boolean mShowsHints;
|
||||||
|
public final boolean mSpaceForLangChange;
|
||||||
public final boolean mShowsLanguageSwitchKey;
|
public final boolean mShowsLanguageSwitchKey;
|
||||||
public final boolean mShowsEmojiKey;
|
public final boolean mShowsEmojiKey;
|
||||||
public final boolean mShowsClipboardKey;
|
public final boolean mShowsClipboardKey;
|
||||||
|
@ -148,6 +149,7 @@ public class SettingsValues {
|
||||||
mIncludesOtherImesInLanguageSwitchList = !Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS || prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false) /* forcibly */;
|
mIncludesOtherImesInLanguageSwitchList = !Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS || prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false) /* forcibly */;
|
||||||
mShowsNumberRow = prefs.getBoolean(Settings.PREF_SHOW_NUMBER_ROW, false);
|
mShowsNumberRow = prefs.getBoolean(Settings.PREF_SHOW_NUMBER_ROW, false);
|
||||||
mShowsHints = prefs.getBoolean(Settings.PREF_SHOW_HINTS, true);
|
mShowsHints = prefs.getBoolean(Settings.PREF_SHOW_HINTS, true);
|
||||||
|
mSpaceForLangChange = prefs.getBoolean(Settings.PREF_SPACE_TO_CHANGE_LANG, true);
|
||||||
mShowsLanguageSwitchKey = prefs.getBoolean(Settings.PREF_SHOW_LANGUAGE_SWITCH_KEY, false);
|
mShowsLanguageSwitchKey = prefs.getBoolean(Settings.PREF_SHOW_LANGUAGE_SWITCH_KEY, false);
|
||||||
mShowsEmojiKey = prefs.getBoolean(Settings.PREF_SHOW_EMOJI_KEY, false);
|
mShowsEmojiKey = prefs.getBoolean(Settings.PREF_SHOW_EMOJI_KEY, false);
|
||||||
mShowsClipboardKey = prefs.getBoolean(Settings.PREF_SHOW_CLIPBOARD_KEY, false);
|
mShowsClipboardKey = prefs.getBoolean(Settings.PREF_SHOW_CLIPBOARD_KEY, false);
|
||||||
|
|
|
@ -217,6 +217,9 @@
|
||||||
<!-- Description of the settings to show hints -->
|
<!-- Description of the settings to show hints -->
|
||||||
<string name="show_hints_summary">Show long-press hints</string>
|
<string name="show_hints_summary">Show long-press hints</string>
|
||||||
|
|
||||||
|
<!-- Title of the settings to disable long press space to change language -->
|
||||||
|
<string name="prefs_long_press_keyboard_to_change_lang">Long press to change lang</string>
|
||||||
|
|
||||||
<!-- Title of the settings to enable keyboard resizing -->
|
<!-- Title of the settings to enable keyboard resizing -->
|
||||||
<string name="prefs_resize_keyboard">Enable keyboard resizing</string>
|
<string name="prefs_resize_keyboard">Enable keyboard resizing</string>
|
||||||
<!-- Title of the settings for setting keyboard height -->
|
<!-- Title of the settings for setting keyboard height -->
|
||||||
|
|
|
@ -34,6 +34,11 @@
|
||||||
android:summary="@string/show_hints_summary"
|
android:summary="@string/show_hints_summary"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:persistent="true" />
|
android:persistent="true" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="prefs_long_press_keyboard_to_change_lang"
|
||||||
|
android:title="@string/prefs_long_press_keyboard_to_change_lang"
|
||||||
|
android:persistent="true"
|
||||||
|
android:defaultValue="true" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="pref_show_language_switch_key"
|
android:key="pref_show_language_switch_key"
|
||||||
android:title="@string/show_language_switch_key"
|
android:title="@string/show_language_switch_key"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue