removed the TAB key
This commit is contained in:
parent
ab21e4ca43
commit
b158ae3a32
11 changed files with 34 additions and 86 deletions
|
|
@ -98,10 +98,6 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
return onKeyScrollSuggestion(validateOnly, false);
|
||||
}
|
||||
|
||||
if (keyCode == settings.getKeyTab()) {
|
||||
return onKeyTab(validateOnly);
|
||||
}
|
||||
|
||||
if (keyCode == settings.getKeySelectKeyboard()) {
|
||||
return onKeySelectKeyboard(validateOnly);
|
||||
}
|
||||
|
|
@ -298,25 +294,6 @@ public abstract class HotkeyHandler extends CommandHandler {
|
|||
}
|
||||
|
||||
|
||||
public boolean onKeyTab(boolean validateOnly) {
|
||||
if (shouldBeOff()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateOnly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (inputType.isMultilineText()) {
|
||||
return onText("\t", validateOnly);
|
||||
} else {
|
||||
textField.sendDownUpKeyEvents(KeyEvent.KEYCODE_TAB);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private boolean onKeySelectKeyboard(boolean validateOnly) {
|
||||
if (!isInputViewShown() || shouldBeOff()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ 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_TAB, KeyEvent.KEYCODE_UNKNOWN);
|
||||
defaultKeys.put(SectionKeymap.ITEM_SELECT_KEYBOARD, KeyEvent.KEYCODE_UNKNOWN);
|
||||
defaultKeys.put(SectionKeymap.ITEM_SHOW_SETTINGS, KeyEvent.KEYCODE_UNKNOWN);
|
||||
defaultKeys.put(SectionKeymap.ITEM_VOICE_INPUT, KeyEvent.KEYCODE_UNKNOWN);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public class HotkeysScreen extends BaseScreenFragment {
|
|||
findPreference(SectionKeymap.ITEM_NEXT_SUGGESTION),
|
||||
findPreference(SectionKeymap.ITEM_NEXT_INPUT_MODE),
|
||||
findPreference(SectionKeymap.ITEM_NEXT_LANGUAGE),
|
||||
findPreference(SectionKeymap.ITEM_TAB),
|
||||
findPreference(SectionKeymap.ITEM_SELECT_KEYBOARD),
|
||||
findPreference(SectionKeymap.ITEM_SHOW_SETTINGS),
|
||||
findPreference(SectionKeymap.ITEM_VOICE_INPUT),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ public class SectionKeymap {
|
|||
public static final String ITEM_NEXT_SUGGESTION = "key_next_suggestion";
|
||||
public static final String ITEM_NEXT_INPUT_MODE = "key_next_input_mode";
|
||||
public static final String ITEM_NEXT_LANGUAGE = "key_next_language";
|
||||
public static final String ITEM_TAB = "key_tab";
|
||||
public static final String ITEM_SELECT_KEYBOARD = "key_select_keyboard";
|
||||
public static final String ITEM_SHOW_SETTINGS = "key_show_settings";
|
||||
public static final String ITEM_VOICE_INPUT = "key_voice_input";
|
||||
|
|
|
|||
|
|
@ -58,9 +58,6 @@ class SettingsHotkeys extends SettingsHacks {
|
|||
public int getKeyNextLanguage() {
|
||||
return getFunctionKey(SectionKeymap.ITEM_NEXT_LANGUAGE);
|
||||
}
|
||||
public int getKeyTab() {
|
||||
return getFunctionKey(SectionKeymap.ITEM_TAB);
|
||||
}
|
||||
public int getKeySelectKeyboard() {
|
||||
return getFunctionKey(SectionKeymap.ITEM_SELECT_KEYBOARD);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package io.github.sspanak.tt9.ui.main.keys;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class SoftKeyAddWord extends SoftKey {
|
||||
public SoftKeyAddWord(Context context) { super(context); }
|
||||
public SoftKeyAddWord(Context context, AttributeSet attrs) { super(context, attrs); }
|
||||
public SoftKeyAddWord(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
|
||||
|
||||
@Override
|
||||
protected boolean handleRelease() {
|
||||
if (validateTT9Handler()) {
|
||||
tt9.addWord();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTitle() {
|
||||
return "+";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
super.render();
|
||||
if (tt9 != null) {
|
||||
setEnabled(!tt9.isVoiceInputActive());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
package io.github.sspanak.tt9.ui.main.keys;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import io.github.sspanak.tt9.R;
|
||||
import io.github.sspanak.tt9.ui.Vibration;
|
||||
|
||||
public class SoftKeyLF2 extends SoftKey {
|
||||
public SoftKeyLF2(Context context) { super(context); }
|
||||
public SoftKeyLF2(Context context, AttributeSet attrs) { super(context, attrs); }
|
||||
public SoftKeyLF2(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); }
|
||||
|
||||
@Override
|
||||
protected void handleHold() {
|
||||
preventRepeat();
|
||||
|
||||
if (!validateTT9Handler()) {
|
||||
return;
|
||||
}
|
||||
|
||||
vibrate(Vibration.getHoldVibration());
|
||||
tt9.addWord();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean handleRelease() {
|
||||
return validateTT9Handler() && tt9.onKeyTab(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTitle() {
|
||||
return "+";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSubTitle() {
|
||||
return getContext().getString(R.string.key_tab).toUpperCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
super.render();
|
||||
if (tt9 != null) {
|
||||
setEnabled(!tt9.isVoiceInputActive());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
android:layout_height="@dimen/numpad_key_height"
|
||||
android:layoutDirection="ltr">
|
||||
|
||||
<io.github.sspanak.tt9.ui.main.keys.SoftKeyLF2
|
||||
<io.github.sspanak.tt9.ui.main.keys.SoftKeyAddWord
|
||||
android:id="@+id/soft_key_add_word"
|
||||
style="@android:style/Widget.Holo.Button.Borderless"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@
|
|||
<string name="key_menu" translatable="false">Menu</string>
|
||||
<string name="key_soft_left" translatable="false">Left Func</string>
|
||||
<string name="key_soft_right" translatable="false">Right Func</string>
|
||||
<string name="key_tab" translatable="false">Tab</string>
|
||||
<string name="key_volume_mute">Volume Mute</string>
|
||||
<string name="key_volume_down">Volume Down</string>
|
||||
<string name="key_volume_up">Volume Up</string>
|
||||
|
|
|
|||
|
|
@ -42,10 +42,6 @@
|
|||
app:key="key_next_input_mode"
|
||||
app:title="@string/function_next_mode" />
|
||||
|
||||
<DropDownPreference
|
||||
app:key="key_tab"
|
||||
app:title="@string/key_tab" />
|
||||
|
||||
<DropDownPreference
|
||||
app:key="key_select_keyboard"
|
||||
app:title="@string/function_select_keyboard" />
|
||||
|
|
|
|||
|
|
@ -123,9 +123,6 @@ Show the text editing panel, which allows you to select, cut, copy, and paste te
|
|||
#### Next Language Key (Default: hold #):
|
||||
Select the next language, when multiple languages have been enabled from the Settings.
|
||||
|
||||
#### Tab Key:
|
||||
Advance the cursor to the next tab stop or switch to the next focusable UI element. Works exactly like the TAB key on a computer keyboard.
|
||||
|
||||
#### Select Keyboard Key:
|
||||
Open the Android Change Keyboard dialog where you can select between all installed keyboards.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue