Skip to content

Key sound and haptic styles; nine-key lone key shows its initial - #129

Merged
Slacker-LLC merged 2 commits into
mainfrom
feat/key-sounds-haptic-styles
Oct 5, 2026
Merged

Slacker-LLC merged 2 commits into
mainfrom
feat/key-sounds-haptic-styles

Conversation

@Slacker-LLC

Copy link
Copy Markdown
Owner

Summary

Folds into a re-release of 0.0.5-beta.1 (the published beta5 will be replaced).

  • Key sounds: 按键音效 offers 系统 plus five clicks synthesized by scripts/generate_key_sounds.py (清脆, 机械, 木质, 打字机, 气泡; 48 kHz mono, under 80 ms, deterministic, no third-party rights). Played through SoundPool as UI sonification; choosing one previews it once.
  • Haptic feel: 震动手感 offers 清脆 (default: PRIMITIVE_TICK / EFFECT_TICK / 8 ms), 有力 (PRIMITIVE_CLICK / EFFECT_CLICK / 12 ms) and 系统 (KEYBOARD_TAP). One-shot fallbacks stay at 8–12 ms because longer pulses ring on linear motors (e.g. Xiaomi's X-axis motor), the "muddy" feel reported on a Xiaomi 15. The strength slider scales both bundled styles.
  • Diagnostics: 关于 → 诊断 lists the vibrator's primitive and amplitude support.
  • Nine-key: a lone 4 / 5 / 7 / 8 / 9 now shows the top candidate's initial (4 → h) instead of the bare digit; the rail highlights the same letter.
  • Both styles are in the user-data archive; the enums live in data so panel and keyboard can share them.

Test plan

  • testDebugUnitTest 375/375 (new aLoneKeyAlignsToTheTopCandidatesInitial), lintDebug no errors
  • Emulator API 36: preferences show 音效 and 震动手感 rows; selecting 机械 saves key_sound_style=mechanical and an app-owned sonification track plays; 清脆 haptics log Primitive=TICK(scale=…); nine-key 4/5/7/8 show h/l/s/t with the rail matching
  • Real-device haptic feel (Xiaomi 15)

🤖 Generated with Claude Code

Slacker-LLC and others added 2 commits October 5, 2026 12:04
- 按键音效 offers 系统 plus five clicks synthesized by
  scripts/generate_key_sounds.py (清脆, 机械, 木质, 打字机, 气泡), played
  through SoundPool as UI sonification; choosing one previews it once.
- 震动手感 offers 清脆 (default: PRIMITIVE_TICK / EFFECT_TICK / 8 ms),
  有力 (PRIMITIVE_CLICK / EFFECT_CLICK / 12 ms) and 系统 (KEYBOARD_TAP).
  One-shot fallbacks stay at 8-12 ms because longer pulses ring on linear
  motors such as Xiaomi's X-axis motor. Both styles are archived.
- 关于 → 诊断 lists the vibrator's capabilities.
- Nine-key: a lone 4/5/7/8/9 now shows the top candidate's initial
  (4 -> h) instead of the bare digit; the rail highlights the same letter.
- The style enums live in data so panel and keyboard can both use them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lone 4/5/7/8/9 first renders the raw digit, then Rime's answer reuses
that strip slot. The candidate TextView was MATCH_PARENT, so setText kept
the digit's width and clipped the character. Use WRAP_CONTENT so a wider
candidate relayouts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Slacker-LLC
Slacker-LLC merged commit f3bb5cc into main Oct 5, 2026
7 checks passed
@Slacker-LLC
Slacker-LLC deleted the feat/key-sounds-haptic-styles branch October 5, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant