Keyboard: remove Term page, add arrows to symbols, fix long-press on drag

- Remove Term page (ABC → #+= → F1-12, was 4 pages now 3)
- Add arrow keys to #+= bottom row replacing CTRL/space
- Cancel long-press timer when finger drags off key, re-enable page swiping

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jima 2026-04-01 18:00:03 +02:00
parent 9e5c3100e2
commit f58258a842
5 changed files with 26 additions and 192 deletions

View file

@ -2,5 +2,5 @@ package com.roundingmobile.sshworkbench
// Auto-generated — do not edit
object BuildTimestamp {
const val TIME = "2026-04-01 15:08:05"
const val TIME = "2026-04-01 17:28:53"
}

View file

@ -308,10 +308,15 @@ class TerminalKeyboard private constructor(
if (idx >= 0) popup.selectedIndex = idx
return true
}
// Update hint when finger slides to a different key
// Cancel long-press if finger moved off the original key
val moveKey = pageView.findKeyAt(event.x, event.y)
if (longPressKey != null && moveKey != longPressKey) {
cancelLongPress()
keyboardView?.setSwipeEnabled(true)
hintPopup?.hide()
}
// Update hint when finger slides to a different key
if (moveKey != null && layout.settings.showHints && moveKey.label.length <= 3) {
// Update pressed state
val pId = event.getPointerId(0)
pageView.setKeyPressed(pId, moveKey)
showHintPopup(moveKey, pageView)

View file

@ -91,65 +91,6 @@
}
]
},
{
"id": "terminal",
"name": "Term",
"rows": [
{
"keys": [
{ "id": "esc", "label": "ESC", "w": 1.2, "action": { "type": "bytes", "value": [27] }, "style": "special" },
{ "id": "tab", "label": "TAB", "w": 1.2, "action": { "type": "bytes", "value": [9] }, "style": "special" },
{ "id": "pipe", "label": "|", "w": 1, "action": { "type": "char", "primary": "|" } },
{ "id": "tilde", "label": "~", "w": 1, "action": { "type": "char", "primary": "~" } },
{ "id": "btick", "label": "`", "w": 1, "action": { "type": "char", "primary": "`" } },
{ "id": "bslash", "label": "\\", "w": 1, "action": { "type": "char", "primary": "\\" } },
{ "id": "amp", "label": "&", "w": 1, "action": { "type": "char", "primary": "&" } }
]
},
{
"keys": [
{ "id": "ctrl_c", "label": "^C", "hint": "SIGINT", "w": 2, "action": { "type": "combo", "mod": ["ctrl"], "key": "c" }, "style": "danger" },
{ "id": "ctrl_z", "label": "^Z", "hint": "suspend", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "z" }, "style": "modifier" },
{ "id": "ctrl_d", "label": "^D", "hint": "EOF", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "d" }, "style": "modifier" },
{ "id": "ctrl_l", "label": "^L", "hint": "clear", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "l" }, "style": "modifier" },
{ "id": "ctrl_r", "label": "^R", "hint": "search", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "r" }, "style": "modifier" }
]
},
{
"keys": [
{ "id": "ctrl_a", "label": "^A", "hint": "home", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "a" }, "style": "modifier" },
{ "id": "ctrl_e", "label": "^E", "hint": "end", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "e" }, "style": "modifier" },
{ "id": "ctrl", "label": "CTRL", "w": 1.3, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "alt", "label": "ALT", "w": 1.3, "action": { "type": "toggle_mod", "mod": "alt" }, "style": "modifier" },
{ "id": "dollar", "label": "$", "w": 1, "action": { "type": "char", "primary": "$" } },
{ "id": "star", "label": "*", "w": 1, "action": { "type": "char", "primary": "*" } },
{ "id": "semi", "label": ";", "w": 1, "action": { "type": "char", "primary": ";" } }
]
},
{
"keys": [
{ "id": "home", "label": "Home", "w": 1, "action": { "type": "esc_seq", "seq": "[H" }, "style": "nav" },
{ "id": "pgup", "label": "PgUp", "w": 1, "action": { "type": "esc_seq", "seq": "[5~" }, "style": "nav" },
{ "id": "ins", "label": "Ins", "w": 1, "action": { "type": "esc_seq", "seq": "[2~" }, "style": "nav" },
{ "id": "del", "label": "Del", "w": 1, "action": { "type": "esc_seq", "seq": "[3~" }, "style": "nav" },
{ "id": "dpad_spacer1", "label": "", "w": 1, "action": { "type": "none" }, "visible": false },
{ "id": "up", "label": "▲", "w": 1.3, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "dpad_spacer2", "label": "", "w": 1, "action": { "type": "none" }, "visible": false }
]
},
{
"keys": [
{ "id": "end", "label": "End", "w": 1, "action": { "type": "esc_seq", "seq": "[F" }, "style": "nav" },
{ "id": "pgdn", "label": "PgDn", "w": 1, "action": { "type": "esc_seq", "seq": "[6~" }, "style": "nav" },
{ "id": "sq", "label": "'", "w": 1, "action": { "type": "char", "primary": "'" } },
{ "id": "dq", "label": "\"", "w": 1, "action": { "type": "char", "primary": "\"" } },
{ "id": "left", "label": "◀", "w": 1.3, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "down", "label": "▼", "w": 1.3, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "right", "label": "▶", "w": 1.3, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true }
]
}
]
},
{
"id": "symbols",
"name": "#+=",
@ -204,10 +145,12 @@
},
{
"keys": [
{ "id": "s_ctrl", "label": "CTRL", "w": 1.5, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "s_space", "label": " ", "w": 3, "action": { "type": "char", "primary": " " }, "longPress": ["\u2699"] },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
{ "id": "s_left", "label": "◀", "w": 1.2, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "s_down", "label": "▼", "w": 1.2, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "s_up", "label": "▲", "w": 1.2, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "s_right", "label": "▶", "w": 1.2, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
]
}
]

View file

@ -92,65 +92,6 @@
}
]
},
{
"id": "terminal",
"name": "Term",
"rows": [
{
"keys": [
{ "id": "esc", "label": "ESC", "w": 1.2, "action": { "type": "bytes", "value": [27] }, "style": "special" },
{ "id": "tab", "label": "TAB", "w": 1.2, "action": { "type": "bytes", "value": [9] }, "style": "special" },
{ "id": "pipe", "label": "|", "w": 1, "action": { "type": "char", "primary": "|" } },
{ "id": "tilde", "label": "~", "w": 1, "action": { "type": "char", "primary": "~" } },
{ "id": "btick", "label": "`", "w": 1, "action": { "type": "char", "primary": "`" } },
{ "id": "bslash", "label": "\\", "w": 1, "action": { "type": "char", "primary": "\\" } },
{ "id": "amp", "label": "&", "w": 1, "action": { "type": "char", "primary": "&" } }
]
},
{
"keys": [
{ "id": "ctrl_c", "label": "^C", "hint": "SIGINT", "w": 2, "action": { "type": "combo", "mod": ["ctrl"], "key": "c" }, "style": "danger" },
{ "id": "ctrl_z", "label": "^Z", "hint": "suspend", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "z" }, "style": "modifier" },
{ "id": "ctrl_d", "label": "^D", "hint": "EOF", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "d" }, "style": "modifier" },
{ "id": "ctrl_l", "label": "^L", "hint": "clear", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "l" }, "style": "modifier" },
{ "id": "ctrl_r", "label": "^R", "hint": "search", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "r" }, "style": "modifier" }
]
},
{
"keys": [
{ "id": "ctrl_a", "label": "^A", "hint": "home", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "a" }, "style": "modifier" },
{ "id": "ctrl_e", "label": "^E", "hint": "end", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "e" }, "style": "modifier" },
{ "id": "ctrl", "label": "CTRL", "w": 1.3, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "alt", "label": "ALT", "w": 1.3, "action": { "type": "toggle_mod", "mod": "alt" }, "style": "modifier" },
{ "id": "dollar", "label": "$", "w": 1, "action": { "type": "char", "primary": "$" } },
{ "id": "star", "label": "*", "w": 1, "action": { "type": "char", "primary": "*" } },
{ "id": "semi", "label": ";", "w": 1, "action": { "type": "char", "primary": ";" } }
]
},
{
"keys": [
{ "id": "home", "label": "Home", "w": 1, "action": { "type": "esc_seq", "seq": "[H" }, "style": "nav" },
{ "id": "pgup", "label": "PgUp", "w": 1, "action": { "type": "esc_seq", "seq": "[5~" }, "style": "nav" },
{ "id": "ins", "label": "Ins", "w": 1, "action": { "type": "esc_seq", "seq": "[2~" }, "style": "nav" },
{ "id": "del", "label": "Del", "w": 1, "action": { "type": "esc_seq", "seq": "[3~" }, "style": "nav" },
{ "id": "dpad_spacer1", "label": "", "w": 1, "action": { "type": "none" }, "visible": false },
{ "id": "up", "label": "▲", "w": 1.3, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "dpad_spacer2", "label": "", "w": 1, "action": { "type": "none" }, "visible": false }
]
},
{
"keys": [
{ "id": "end", "label": "End", "w": 1, "action": { "type": "esc_seq", "seq": "[F" }, "style": "nav" },
{ "id": "pgdn", "label": "PgDn", "w": 1, "action": { "type": "esc_seq", "seq": "[6~" }, "style": "nav" },
{ "id": "sq", "label": "'", "w": 1, "action": { "type": "char", "primary": "'" } },
{ "id": "dq", "label": "\"", "w": 1, "action": { "type": "char", "primary": "\"" } },
{ "id": "left", "label": "◀", "w": 1.3, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "down", "label": "▼", "w": 1.3, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "right", "label": "▶", "w": 1.3, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true }
]
}
]
},
{
"id": "symbols",
"name": "#+=",
@ -205,10 +146,12 @@
},
{
"keys": [
{ "id": "s_ctrl", "label": "CTRL", "w": 1.5, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "s_space", "label": " ", "w": 3, "action": { "type": "char", "primary": " " }, "longPress": ["\u2699"] },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
{ "id": "s_left", "label": "◀", "w": 1.2, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "s_down", "label": "▼", "w": 1.2, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "s_up", "label": "▲", "w": 1.2, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "s_right", "label": "▶", "w": 1.2, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
]
}
]

View file

@ -94,65 +94,6 @@
}
]
},
{
"id": "terminal",
"name": "Term",
"rows": [
{
"keys": [
{ "id": "esc", "label": "ESC", "w": 1.2, "action": { "type": "bytes", "value": [27] }, "style": "special" },
{ "id": "tab", "label": "TAB", "w": 1.2, "action": { "type": "bytes", "value": [9] }, "style": "special" },
{ "id": "pipe", "label": "|", "w": 1, "action": { "type": "char", "primary": "|" } },
{ "id": "tilde", "label": "~", "w": 1, "action": { "type": "char", "primary": "~" } },
{ "id": "btick", "label": "`", "w": 1, "action": { "type": "char", "primary": "`" } },
{ "id": "bslash", "label": "\\", "w": 1, "action": { "type": "char", "primary": "\\" } },
{ "id": "amp", "label": "&", "w": 1, "action": { "type": "char", "primary": "&" } }
]
},
{
"keys": [
{ "id": "ctrl_c", "label": "^C", "hint": "SIGINT", "w": 2, "action": { "type": "combo", "mod": ["ctrl"], "key": "c" }, "style": "danger" },
{ "id": "ctrl_z", "label": "^Z", "hint": "suspend", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "z" }, "style": "modifier" },
{ "id": "ctrl_d", "label": "^D", "hint": "EOF", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "d" }, "style": "modifier" },
{ "id": "ctrl_l", "label": "^L", "hint": "clear", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "l" }, "style": "modifier" },
{ "id": "ctrl_r", "label": "^R", "hint": "search", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "r" }, "style": "modifier" }
]
},
{
"keys": [
{ "id": "ctrl_a", "label": "^A", "hint": "home", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "a" }, "style": "modifier" },
{ "id": "ctrl_e", "label": "^E", "hint": "end", "w": 1.3, "action": { "type": "combo", "mod": ["ctrl"], "key": "e" }, "style": "modifier" },
{ "id": "ctrl", "label": "CTRL", "w": 1.3, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "alt", "label": "ALT", "w": 1.3, "action": { "type": "toggle_mod", "mod": "alt" }, "style": "modifier" },
{ "id": "dollar", "label": "$", "w": 1, "action": { "type": "char", "primary": "$" } },
{ "id": "star", "label": "*", "w": 1, "action": { "type": "char", "primary": "*" } },
{ "id": "semi", "label": ";", "w": 1, "action": { "type": "char", "primary": ";" } }
]
},
{
"keys": [
{ "id": "home", "label": "Home", "w": 1, "action": { "type": "esc_seq", "seq": "[H" }, "style": "nav" },
{ "id": "pgup", "label": "PgUp", "w": 1, "action": { "type": "esc_seq", "seq": "[5~" }, "style": "nav" },
{ "id": "ins", "label": "Ins", "w": 1, "action": { "type": "esc_seq", "seq": "[2~" }, "style": "nav" },
{ "id": "del", "label": "Del", "w": 1, "action": { "type": "esc_seq", "seq": "[3~" }, "style": "nav" },
{ "id": "dpad_spacer1", "label": "", "w": 1, "action": { "type": "none" }, "visible": false },
{ "id": "up", "label": "▲", "w": 1.3, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "dpad_spacer2", "label": "", "w": 1, "action": { "type": "none" }, "visible": false }
]
},
{
"keys": [
{ "id": "end", "label": "End", "w": 1, "action": { "type": "esc_seq", "seq": "[F" }, "style": "nav" },
{ "id": "pgdn", "label": "PgDn", "w": 1, "action": { "type": "esc_seq", "seq": "[6~" }, "style": "nav" },
{ "id": "sq", "label": "'", "w": 1, "action": { "type": "char", "primary": "'" } },
{ "id": "dq", "label": "\"", "w": 1, "action": { "type": "char", "primary": "\"" } },
{ "id": "left", "label": "◀", "w": 1.3, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "down", "label": "▼", "w": 1.3, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "right", "label": "▶", "w": 1.3, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true }
]
}
]
},
{
"id": "symbols",
"name": "#+=",
@ -207,10 +148,12 @@
},
{
"keys": [
{ "id": "s_ctrl", "label": "CTRL", "w": 1.5, "action": { "type": "toggle_mod", "mod": "ctrl" }, "style": "modifier" },
{ "id": "s_space", "label": " ", "w": 3, "action": { "type": "char", "primary": " " }, "longPress": ["\u2699"] },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
{ "id": "s_left", "label": "◀", "w": 1.2, "action": { "type": "esc_seq", "seq": "[D" }, "style": "nav", "repeatable": true },
{ "id": "s_down", "label": "▼", "w": 1.2, "action": { "type": "esc_seq", "seq": "[B" }, "style": "nav", "repeatable": true },
{ "id": "s_up", "label": "▲", "w": 1.2, "action": { "type": "esc_seq", "seq": "[A" }, "style": "nav", "repeatable": true },
{ "id": "s_right", "label": "▶", "w": 1.2, "action": { "type": "esc_seq", "seq": "[C" }, "style": "nav", "repeatable": true },
{ "id": "s_bksp", "label": "⌫", "w": 1.5, "action": { "type": "bytes", "value": [127] }, "style": "danger", "repeatable": true },
{ "id": "s_enter", "label": "⏎", "w": 1.5, "action": { "type": "bytes", "value": [13] }, "style": "confirm" }
]
}
]