Skip to content

Commit 4d1e80c

Browse files
exdekotiveclaude
andcommitted
v1.2: Shift+Tab on soft keyboard + swap ASR to Qwen3-ASR-Flash
Two independent improvements from real-device testing: 1. Shift+Tab — softkb.c The 3DS soft keyboard's Tab key now respects the physical L (Shift) modifier. Holding L while tapping Tab emits CSI Z ("\x1b[Z"), the terminal-standard escape sequence for "cursor backward tabulation" that most TUIs interpret as Shift+Tab — useful for reverse-cycling completions in vim/zsh, walking backwards through tmux panes after Ctrl-B q, and similar. Touch is two lines in the KIND_SEQ dispatch: when L is held AND the sequence is literally "\t", swap for "\x1b[Z" before returning. Plain Tab (no modifier) still emits "\t" unchanged. Only "\t" is special-cased; other KIND_SEQ bindings pass through verbatim. 2. ASR model swap — tools/whisper_shim.py OPENROUTER_AUDIO_MODEL changed from "openai/whisper-large-v3-turbo" to "qwen/qwen3-asr-flash-2026-02-10". Same JSON request / response shape on OpenRouter's /v1/audio/transcriptions endpoint, so no protocol or parsing changes. Motivations: - User report: OpenRouter's Whisper Turbo provider occasionally blocks / rate-limits requests from certain IPs, where the same audio through Qwen ASR succeeds. - Qwen tends to emit more idiomatic Chinese punctuation ("你好,世界。" vs Whisper's "你好世界,"). - Pinning the dated snapshot (2026-02-10) because OpenRouter does not expose an unpinned alias for this model. Pricing roughly 2× higher (~$0.13/audio-hour vs $0.067) but still negligible at personal-use volumes. Both verified on real 3DS hardware before push. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1f6becf commit 4d1e80c

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

source/softkb.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,14 @@ const char *softkb_touch(softkb_t *kb,
459459
kb->repeat_idx = -2;
460460
return NULL;
461461
case KIND_SEQ:
462+
/* Shift + Tab = "cursor backward tabulation" (CSI Z) — the
463+
* terminal-standard escape for shift-tab. Catches the
464+
* common case (only seq we currently bind is "\t"); other
465+
* KIND_SEQ keys pass through verbatim. */
466+
if (keyboard_shift_held(kbd) && k->seq
467+
&& k->seq[0] == '\t' && k->seq[1] == '\0') {
468+
return "\x1b[Z";
469+
}
462470
return k->seq;
463471
case KIND_SPACE:
464472
/* In CN mode with an active pinyin buffer, space commits

tools/whisper_shim.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@
5050
SOCK_PATH = "/tmp/dssh-whisper.sock"
5151

5252
OPENROUTER_AUDIO_URL = "https://openrouter.ai/api/v1/audio/transcriptions"
53-
OPENROUTER_AUDIO_MODEL = "openai/whisper-large-v3-turbo"
53+
# Switched from openai/whisper-large-v3-turbo → qwen/qwen3-asr-flash-...
54+
# in v1.2 because OpenRouter's Whisper turbo provider occasionally
55+
# rate-limits / blocks requests from certain IP ranges, while the Qwen
56+
# ASR endpoint has been stable for the same audio. Same JSON request
57+
# shape, same {text, usage} response shape — no protocol changes
58+
# needed. Qwen also tends to emit better Chinese punctuation
59+
# ("你好,世界。" vs Whisper's "你好世界,"). Pricing is about 2× higher
60+
# but still negligible at personal-use volumes. Pin the dated snapshot
61+
# because OpenRouter doesn't expose an unpinned alias.
62+
OPENROUTER_AUDIO_MODEL = "qwen/qwen3-asr-flash-2026-02-10"
5463
AUDIO_LANG = "zh"
5564
AUDIO_TIMEOUT_SEC = 30
5665

0 commit comments

Comments
 (0)