swapped the default hotkeys for SHIFT and COMMAND PALETTE and disabled SHIFT when in phone and strict numeric fields
This commit is contained in:
parent
ec38a606df
commit
2f995f486e
5 changed files with 12 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ abstract public class CommandHandler extends TextEditingHandler {
|
|||
|
||||
@Override
|
||||
public boolean onHotkey(int keyCode, boolean repeat, boolean validateOnly) {
|
||||
return mainView.isCommandPaletteShown() && keyCode != settings.getKeyCommandPalette();
|
||||
return mainView.isCommandPaletteShown() && Math.abs(keyCode) != Math.abs(settings.getKeyCommandPalette());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -300,6 +300,10 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
|
||||
|
||||
public boolean onKeyNextTextCase(boolean validateOnly) {
|
||||
if (voiceInputOps.isListening() || inputType.isNumeric() || inputType.isPhoneNumber()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnly) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class Hotkeys {
|
|||
defaultKeys.put(SectionKeymap.ITEM_BACKSPACE, 0);
|
||||
}
|
||||
|
||||
defaultKeys.put(SectionKeymap.ITEM_COMMAND_PALETTE, KeyEvent.KEYCODE_STAR);
|
||||
defaultKeys.put(SectionKeymap.ITEM_COMMAND_PALETTE, -KeyEvent.KEYCODE_STAR); // negative means "hold"
|
||||
defaultKeys.put(SectionKeymap.ITEM_EDIT_TEXT, KeyEvent.KEYCODE_UNKNOWN);
|
||||
|
||||
defaultKeys.put(
|
||||
|
|
@ -93,7 +93,7 @@ public class Hotkeys {
|
|||
defaultKeys.put(SectionKeymap.ITEM_NEXT_INPUT_MODE, KeyEvent.KEYCODE_POUND);
|
||||
defaultKeys.put(SectionKeymap.ITEM_NEXT_LANGUAGE, -KeyEvent.KEYCODE_POUND); // negative means "hold"
|
||||
defaultKeys.put(SectionKeymap.ITEM_SELECT_KEYBOARD, KeyEvent.KEYCODE_UNKNOWN);
|
||||
defaultKeys.put(SectionKeymap.ITEM_SHIFT, -KeyEvent.KEYCODE_STAR);
|
||||
defaultKeys.put(SectionKeymap.ITEM_SHIFT, KeyEvent.KEYCODE_STAR);
|
||||
defaultKeys.put(SectionKeymap.ITEM_SHOW_SETTINGS, KeyEvent.KEYCODE_UNKNOWN);
|
||||
defaultKeys.put(SectionKeymap.ITEM_VOICE_INPUT, KeyEvent.KEYCODE_UNKNOWN);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@ import java.util.HashMap;
|
|||
import io.github.sspanak.tt9.preferences.screens.hotkeys.SectionKeymap;
|
||||
|
||||
class SettingsHotkeys extends SettingsHacks {
|
||||
private static final String HOTKEY_VERSION = "hotkeys_v5";
|
||||
|
||||
SettingsHotkeys(Context context) { super(context); }
|
||||
|
||||
public boolean areHotkeysInitialized() {
|
||||
return !prefs.getBoolean("hotkeys_v4_initialized", false);
|
||||
return !prefs.getBoolean(HOTKEY_VERSION, false);
|
||||
}
|
||||
|
||||
public void setDefaultKeys(HashMap<String, Integer> defaultKeys) {
|
||||
|
|
@ -19,7 +21,7 @@ class SettingsHotkeys extends SettingsHacks {
|
|||
prefsEditor.putString(key, String.valueOf(defaultKeys.get(key)));
|
||||
}
|
||||
|
||||
prefsEditor.putBoolean("hotkeys_v4_initialized", true).apply();
|
||||
prefsEditor.putBoolean(HOTKEY_VERSION, true).apply();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@ public class SoftKeyShift extends SoftKey {
|
|||
setTextSize(30);
|
||||
setTypeface(Typeface.DEFAULT_BOLD);
|
||||
super.render();
|
||||
setEnabled(tt9 != null && !tt9.isVoiceInputActive() && !tt9.isInputModeNumeric());
|
||||
setEnabled(tt9 != null && !tt9.isVoiceInputActive() && !tt9.isInputModePhone() && !tt9.isNumericModeSigned());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue