make long press symbols key -> numpad optional, fixes #588

This commit is contained in:
Helium314 2024-04-07 10:03:08 +02:00
parent 58e56e5528
commit 1c075de0c8
6 changed files with 19 additions and 9 deletions

View file

@ -1107,7 +1107,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
return;
}
}
if (code == KeyCode.ALPHA_SYMBOL) {
if (code == KeyCode.ALPHA_SYMBOL && Settings.getInstance().getCurrent().mLongPressSymbolsForNumpad) {
sListener.onCodeInput(KeyCode.NUMPAD, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false);
return;
}

View file

@ -116,6 +116,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static final String PREF_GESTURE_SPACE_AWARE = "gesture_space_aware";
public static final String PREF_SHOW_SETUP_WIZARD_ICON = "show_setup_wizard_icon";
public static final String PREF_USE_CONTACTS = "use_contacts";
public static final String PREFS_LONG_PRESS_SYMBOLS_FOR_NUMPAD = "long_press_symbols_for_numpad";
// one-handed mode gravity, enablement and scale, stored separately per orientation
public static final String PREF_ONE_HANDED_MODE_PREFIX = "one_handed_mode_enabled_p_";

View file

@ -54,7 +54,7 @@ public class SettingsValues {
public final Locale mLocale;
public final boolean mHasHardwareKeyboard;
public final int mDisplayOrientation;
// From preferences, in the same order as xml/prefs.xml:
// From preferences
public final boolean mAutoCap;
public final boolean mVibrateOn;
public final boolean mSoundOn;
@ -86,8 +86,7 @@ public class SettingsValues {
public final List<String> mPopupKeyTypes;
public final List<String> mPopupKeyLabelSources;
public final List<Locale> mSecondaryLocales;
// Use bigrams to predict the next word when there is no input for it yet
public final boolean mBigramPredictionEnabled;
public final boolean mBigramPredictionEnabled;// Use bigrams to predict the next word when there is no input for it yet
public final boolean mGestureInputEnabled;
public final boolean mGestureTrailEnabled;
public final boolean mGestureFloatingPreviewTextEnabled;
@ -119,12 +118,13 @@ public class SettingsValues {
private final boolean mOverrideShowingSuggestions;
public final SettingsValuesForSuggestion mSettingsValuesForSuggestion;
public final boolean mIncognitoModeEnabled;
public final boolean mLongPressSymbolsForNumpad;
// User-defined colors
public final Colors mColors;
@Nullable
public final String mAccount;
public final String mAccount; // todo: always null, remove?
// creation of Colors and SpacingAndPunctuations are the slowest parts in here, but still ok
public SettingsValues(final Context context, final SharedPreferences prefs, final Resources res,
@ -232,6 +232,7 @@ public class SettingsValues {
);
mSpacingAndPunctuations = new SpacingAndPunctuations(res, mUrlDetectionEnabled);
mBottomPaddingScale = prefs.getFloat(Settings.PREF_BOTTOM_PADDING_SCALE, DEFAULT_SIZE_SCALE);
mLongPressSymbolsForNumpad = prefs.getBoolean(Settings.PREFS_LONG_PRESS_SYMBOLS_FOR_NUMPAD, false);
}
public boolean isApplicationSpecifiedCompletionsOn() {