Save state before swipe engine work

This commit is contained in:
2026-07-07 02:59:52 -04:00
parent e2d5b47c7c
commit 939e8da252
8 changed files with 30 additions and 16 deletions
Binary file not shown.
+6 -5
View File
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<row height="0.95">
<key width="1.5" role="action" key0="ctrl" key1="loc meta" key6="loc switch_clipboard"/>
<key width="1.3" role="action" key0="alt"/>
<key width="6.0" role="space_bar" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right"/>
<key width="1.4" role="action" key0="fn" key1="config" key2="tux" key6="loc voice_typing"/>
<key width="1.6" role="action" key0="enter" key2="action"/>
<key width="1.5" role="action" key0="ctrl" key1="loc meta" key3="loc switch_clipboard"/>
<key width="1.3" role="action" key0="alt" key1="config"/>
<key width="1.0" role="action" key7="pgup" key8="pgdn"/>
<key width="5.5" role="space_bar" key0="space" key7="switch_forward" key8="switch_backward" key5="cursor_left" key6="cursor_right"/>
<key width="1.4" role="action" key0="fn" key2="meta" key3="loc voice_typing"/>
<key width="1.5" role="action" key0="enter" key2="action"/>
</row>
+3 -3
View File
@@ -107,7 +107,7 @@ public final class Config
marginTop = res.getDimension(R.dimen.margin_top);
keyPadding = res.getDimension(R.dimen.key_padding);
labelTextSize = 0.33f;
sublabelTextSize = 0.22f;
sublabelTextSize = 0.21f;
// from prefs
refresh(res, foldableUnfolded, dicts);
// initialized later
@@ -157,7 +157,7 @@ public final class Config
slide_step_px = slider_sensitivity * swipe_scaling;
vibrate_custom = _prefs.getBoolean("vibrate_custom", false);
vibrate_duration = _prefs.getInt("vibrate_duration", 20);
longPressTimeout = _prefs.getInt("longpress_timeout", 700);
longPressTimeout = _prefs.getInt("longpress_timeout", 600);
longPressInterval = _prefs.getInt("longpress_interval", 65);
keyrepeat_enabled = _prefs.getBoolean("keyrepeat_enabled", true);
margin_bottom = get_dip_pref_oriented(dm, "margin_bottom", 7, 3);
@@ -179,7 +179,7 @@ public final class Config
// a layout in KeyboardData unit. The keyboard will be higher if the layout
// has more rows and smaller if it has less because rows stay the same
// height.
keyboard_rows_height_pixels = screenHeightPixels * keyboardHeightPercent / 395;
keyboard_rows_height_pixels = (int)(screenHeightPixels * keyboardHeightPercent / 395 * 0.9f);
horizontal_margin =
get_dip_pref_oriented(dm, "horizontal_margin", 3, 28);
double_tap_lock_shift = _prefs.getBoolean("lock_double_tap", false);
+3 -1
View File
@@ -589,7 +589,7 @@ public final class KeyValue implements Comparable<KeyValue>
case "box": return modifierKey("Box", Modifier.BOX, 0);
case "fn": return modifierKey("Fn", Modifier.FN, 0);
case "meta": return modifierKey("Meta", Modifier.META, 0);
case "tux": return modifierKey(String.valueOf((char)0xE002), Modifier.META, FLAG_KEY_FONT);
case "tux": return modifierKey("Meta", Modifier.META, 0);
/* Combining diacritics */
/* Glyphs is the corresponding dead-key + 0x0100. */
@@ -672,6 +672,8 @@ public final class KeyValue implements Comparable<KeyValue>
case "left": return keyeventKey(0xE008, KeyEvent.KEYCODE_DPAD_LEFT, FLAG_SMALLER_FONT);
case "page_up": return keyeventKey(0xE002, KeyEvent.KEYCODE_PAGE_UP, 0);
case "page_down": return keyeventKey(0xE003, KeyEvent.KEYCODE_PAGE_DOWN, 0);
case "pgup": return keyeventKey("pgup", KeyEvent.KEYCODE_PAGE_UP, FLAG_SMALLER_FONT);
case "pgdn": return keyeventKey("pgdn", KeyEvent.KEYCODE_PAGE_DOWN, FLAG_SMALLER_FONT);
case "home": return keyeventKey(0xE00B, KeyEvent.KEYCODE_MOVE_HOME, FLAG_SMALLER_FONT);
case "end": return keyeventKey(0xE00C, KeyEvent.KEYCODE_MOVE_END, FLAG_SMALLER_FONT);
case "delete": return keyeventKey(0xE010, KeyEvent.KEYCODE_FORWARD_DEL, 0);
+15 -1
View File
@@ -214,7 +214,13 @@ public final class Pointers implements Handler.Callback
KeyValue value = _handler.modifyKey(key.keys[0], mods);
Pointer ptr = make_pointer(pointerId, key, value, x, y, mods);
_ptrs.add(ptr);
startLongPress(ptr);
// Space bar gets a slightly shorter long-press (500ms) so the joypad
// activates quickly when holding space
if (value != null && value.getKind() == KeyValue.Kind.Editing
&& value.getEditing() == KeyValue.Editing.SPACE_BAR)
startLongPress(ptr, 500);
else
startLongPress(ptr);
_handler.onPointerDown(value, false);
}
@@ -442,6 +448,14 @@ public final class Pointers implements Handler.Callback
_longpress_handler.sendEmptyMessageDelayed(what, _config.longPressTimeout);
}
/** Start long-press timer with a custom timeout override (ms). */
private void startLongPress(Pointer ptr, long timeoutMs)
{
int what = (uniqueTimeoutWhat++);
ptr.timeoutWhat = what;
_longpress_handler.sendEmptyMessageDelayed(what, timeoutMs);
}
private void stopLongPress(Pointer ptr)
{
_longpress_handler.removeMessages(ptr.timeoutWhat);
@@ -101,7 +101,7 @@ public class CandidatesView extends LinearLayout
float row_height = config.keyboard_rows_height_pixels * (1 - config.key_vertical_margin);
ViewGroup.MarginLayoutParams p =
(ViewGroup.MarginLayoutParams)getLayoutParams();
p.height = (int)row_height;
p.height = (int)(row_height * 0.6f);
setLayoutParams(p);
// Match the size of labels on the keyboard.
float text_size = row_height * config.characterSize * config.labelTextSize;
+2 -1
View File
@@ -66,10 +66,11 @@ Useful links.
<key c="z"/>
<key c="x" ne="loc †"/>
<key c="c" ne="&lt;" sw="."/>
<key c="v" ne="&gt;" sw=","/>
<key c="v" ne="&gt;"/>
<key c="b" ne="\?" sw="/"/>
<key c="n" ne=":" sw=";"/>
<key c="m" ne="&quot;" sw="'"/>
<key c="." key3=","/>
<key role="action" c="backspace" ne="delete"/>
</row>
</keyboard>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Tux (Linux penguin) outline icon for meta/super key -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,3C8.69,3 6,5.69 6,9C6,10.09 6.29,11.12 6.79,12H6C4.9,12 4,12.9 4,14C4,14.75 4.42,15.42 5.03,15.79C5.01,15.86 5,15.93 5,16C5,17.1 5.9,18 7,18C7.28,18 7.54,17.93 7.78,17.82C8.43,19.22 9.84,20.17 11.5,20.17C13.16,20.17 14.57,19.22 15.22,17.82C15.46,17.93 15.72,18 16,18C17.1,18 18,17.1 18,16C18,15.93 17.99,15.86 17.97,15.79C18.58,15.42 19,14.75 19,14C19,12.9 18.1,12 17,12H17.21C17.71,11.12 18,10.09 18,9C18,5.69 15.31,3 12,3M11,5V6H10V5H11M12,5H13V6H12V5M8.5,7C9.33,7 10,7.67 10,8.5C10,9.33 9.33,10 8.5,10C7.67,10 7,9.33 7,8.5C7,7.67 7.67,7 8.5,7M15.5,7C16.33,7 17,7.67 17,8.5C17,9.33 16.33,10 15.5,10C14.67,10 14,9.33 14,8.5C14,7.67 14.67,7 15.5,7M11,11H13V12.5C13,12.78 12.78,13 12.5,13H11.5C11.22,13 11,12.78 11,12.5V11Z" /></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB