Skip to content

Improve keyboard layout spacing and key preview behavior#22

Merged
jamditis merged 1 commit intomainfrom
claude/expand-keyboard-tap-areas-BuH4a
Feb 21, 2026
Merged

Improve keyboard layout spacing and key preview behavior#22
jamditis merged 1 commit intomainfrom
claude/expand-keyboard-tap-areas-BuH4a

Conversation

@jamditis
Copy link
Owner

Summary

This PR refines the keyboard UI layout and improves the key preview interaction experience by adjusting dimensions, spacing, and adding delayed preview dismissal.

Key Changes

  • Layout Spacing: Reduced horizontal padding in extra_row and number_row from 2dp to 1dp, and reduced key margins from 2dp to 1dp for more compact layout
  • Key Heights: Increased button heights from 36dp to 40dp across all extra row keys (ESC, Tab, Ctrl, arrow keys, etc.) and number row keys for better touch targets
  • Key Preview Behavior:
    • Added delayed dismissal of key preview (300ms) instead of immediate hiding, allowing preview to remain visible briefly after key release
    • Preview hide is cancelled if another key is pressed before the delay completes
    • Added touch slop (4dp) to ACTION_MOVE detection to prevent accidental key deselection during slight finger movements
  • Code Refactoring: Introduced previewHideRunnable variable to track and manage delayed preview hide operations

Implementation Details

  • The delayed preview hide uses longPressHandler.postDelayed() to schedule dismissal after 300ms
  • Touch slop is applied symmetrically to horizontal bounds checking during drag operations
  • Preview hide runnable is properly cancelled when a new key press begins, ensuring smooth transitions between key presses

https://claude.ai/code/session_01WRedvWA2k9ZUQtWd2cWEtY

- QWERTY key margins: 2dp → 1dp (all sides), row padding 2dp → 1dp
  Net: each key's touch target grows by ~2dp on every edge
- Add 4dp horizontal slop to drag-off inBounds check so fast diagonal
  swipes don't prematurely cancel a tap
- Key preview now lingers 300ms after finger lifts so the user can see
  which key was registered; next keydown cancels the pending hide
  immediately so the preview snaps to the new key without flicker
- Extra row buttons: height 36dp → 40dp, padding 2dp → 1dp
- Number row buttons: height match_parent → 40dp (explicit), padding 2dp → 1dp

https://claude.ai/code/session_01WRedvWA2k9ZUQtWd2cWEtY
@jamditis jamditis merged commit 38dc5d0 into main Feb 21, 2026
1 check passed
@jamditis jamditis deleted the claude/expand-keyboard-tap-areas-BuH4a branch February 21, 2026 03:24
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.

2 participants