mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-18 21:32:04 +00:00
long-press symbols key for numpad
issue: immediately switches to symbols layout, after delay switches to numpad
This commit is contained in:
parent
21254d895c
commit
eb7333b1da
5 changed files with 18 additions and 9 deletions
|
@ -45,6 +45,7 @@ Features that may go unnoticed, and further potentially useful information
|
|||
* Long-press a suggestion in the suggestion strip to show more suggestions, and a delete button to remove this suggestion.
|
||||
* Swipe up from a suggestion to open more suggestions, and release on the suggestion to select it.
|
||||
* Long-press an entry in the clipboard history to pin it (keep it in clipboard until you unpin).
|
||||
* Long-press the `?123` from main view to directly open numpad.
|
||||
* Swipe left in clipboard view to remove an entry (except when it's pinned)
|
||||
* You can add dictionaries by opening them in a file explorer:
|
||||
* This only works with _content-uris_ and not with _file-uris_, meaning that it may not work with some file explorers.
|
||||
|
|
|
@ -1159,7 +1159,10 @@ public class Key implements Comparable<Key> {
|
|||
}
|
||||
|
||||
// action flags don't need to be specified, they can be deduced from the key
|
||||
if (backgroundType == BACKGROUND_TYPE_SPACEBAR || mCode == Constants.CODE_LANGUAGE_SWITCH)
|
||||
if (backgroundType == BACKGROUND_TYPE_SPACEBAR
|
||||
|| mCode == Constants.CODE_LANGUAGE_SWITCH
|
||||
|| (mCode == CODE_SWITCH_ALPHA_SYMBOL && !params.mId.isAlphabetKeyboard())
|
||||
)
|
||||
actionFlags |= ACTION_FLAGS_ENABLE_LONG_PRESS;
|
||||
if (mCode <= Constants.CODE_SPACE && mCode != CODE_OUTPUT_TEXT)
|
||||
actionFlags |= ACTION_FLAGS_NO_KEY_PREVIEW;
|
||||
|
|
|
@ -310,8 +310,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
|||
|
||||
// Note that we need primaryCode argument because the keyboard may be in shifted state and the
|
||||
// primaryCode is different from {@link Key#mKeyCode}.
|
||||
private void callListenerOnRelease(final Key key, final int primaryCode,
|
||||
final boolean withSliding) {
|
||||
private void callListenerOnRelease(final Key key, final int primaryCode, final boolean withSliding) {
|
||||
// See the comment at {@link #callListenerOnPressAndCheckKeyboardLayoutChange(Key}}.
|
||||
if (sInGesture || mIsDetectingGesture || mIsTrackingForActionDisabled) {
|
||||
return;
|
||||
|
@ -1104,7 +1103,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
|||
return;
|
||||
}
|
||||
final int code = key.getCode();
|
||||
if (code == Constants.CODE_SPACE&&Settings.getInstance().getCurrent().mSpaceForLangChange || code == Constants.CODE_LANGUAGE_SWITCH) {
|
||||
if (code == Constants.CODE_LANGUAGE_SWITCH
|
||||
|| (code == Constants.CODE_SPACE && Settings.getInstance().getCurrent().mSpaceForLangChange)
|
||||
) {
|
||||
// Long pressing the space key invokes IME switcher dialog.
|
||||
if (sListener.onCustomRequest(Constants.CUSTOM_CODE_SHOW_INPUT_METHOD_PICKER)) {
|
||||
cancelKeyTracking();
|
||||
|
@ -1112,8 +1113,12 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
|
||||
sListener.onCodeInput(Constants.CODE_NUMPAD, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE, false);
|
||||
return;
|
||||
}
|
||||
|
||||
setReleasedKeyGraphics(key, false /* withAnimation */);
|
||||
setReleasedKeyGraphics(key, false);
|
||||
final MoreKeysPanel moreKeysPanel = sDrawingProxy.showMoreKeysKeyboard(key, this);
|
||||
if (moreKeysPanel == null) {
|
||||
return;
|
||||
|
@ -1159,8 +1164,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
|||
return true;
|
||||
}
|
||||
// Here curKey points to the different key from newKey.
|
||||
final int keyHysteresisDistanceSquared = mKeyDetector.getKeyHysteresisDistanceSquared(
|
||||
mIsInSlidingKeyInput);
|
||||
final int keyHysteresisDistanceSquared = mKeyDetector.getKeyHysteresisDistanceSquared(mIsInSlidingKeyInput);
|
||||
final int distanceFromKeyEdgeSquared = curKey.squaredDistanceToEdge(x, y);
|
||||
if (distanceFromKeyEdgeSquared >= keyHysteresisDistanceSquared) {
|
||||
if (DEBUG_MODE) {
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
<string name="prefs_long_press_keyboard_to_change_lang_summary">Long pressing space key will prompt input method selection menu</string>
|
||||
<string name="settings_no_limit">No limit</string>
|
||||
<string name="settings_category_clipboard_history">Clipboard history</string>
|
||||
<string name="abbreviation_unit_minutes"><xliff:g id="MINUTES">%s</xliff:g>min.</string>
|
||||
<string name="abbreviation_unit_minutes"><xliff:g id="MINUTES">%s</xliff:g> min</string>
|
||||
<string name="enable_clipboard_history">Enable clipboard history</string>
|
||||
<string name="enable_clipboard_history_summary">If disabled, clipboard key will paste clipboard content if any</string>
|
||||
<string name="clipboard_history_retention_time">History retention time</string>
|
||||
|
|
|
@ -13,6 +13,7 @@ If you use an external glide typing library, you likely will have issues if your
|
|||
|
||||
There are special key labels that are intended for internal use only, but can (currently) be set on custom layouts too. An example is `!icon/previous_key|!code/key_action_previous`, so it's unlikely you will stumble upon issues here when not intentionally provoking it.
|
||||
One special label that might be wanted though is `$$$`, which will be replaced by the local currency. `$$$1` - `$$$4` will be replaced by currencies available on long-pressing the currency key.
|
||||
If you want different key label and use text, set the label to [label]|[text], e.g. `aa|bb` will show `aa`, but pressing the key will input `bb`.
|
||||
|
||||
## Simple format
|
||||
* One key per line
|
||||
|
|
Loading…
Add table
Reference in a new issue