Skip to content

Implement Auto-Spacing After Punctuation & Double-Tap Space for Period #669

Description

@prince-0408

Terms

Description

To align Scribe-Android with modern keyboard standard UX (such as Gboard, SwiftKey, and OpenBoard), we propose adding two essential typing shortcuts:

  1. Auto-Spacing After Punctuation

    • Automatically insert a space after typing punctuation marks (., ,, !, ?) when followed by a letter character.
    • Prevents words from running together (e.g. typing hello.world automatically formats to hello. world).
  2. Refined Double-Tap Space for Period (. ) with Time Threshold

    • Pressing the spacebar twice in rapid succession (e.g. within 300ms–400ms) automatically converts the double space into a period followed by a space (. ) and triggers auto-capitalization for the next word.
    • Enhance the existing logic in SpaceKeyProcessor to include double-press timestamp thresholds to prevent accidental trigger during slow typing.

Proposed Technical Implementation Details

  • SpaceKeyProcessor.kt:
    • Add timestamp tracking (lastSpacePressTime) in handleSpaceOutsideCommandBar() to verify rapid double-press interval.
    • Set mShiftState = SHIFT_ON_ONE_CHAR on keyboard to enable auto-capitalization after period insertion.
  • Punctuation Key Handling (GeneralKeyboardIME / KeyHandler):
    • Detect when punctuation key codes (., ,, !, ?) are pressed and automatically queue/commit a space or format text before the next alphabetical character.
  • Preferences (PreferencesHelper.kt / SettingsScreen.kt):
    • Add toggle preference for "Auto-spacing after punctuation".
    • Link with existing getEnablePeriodOnSpaceBarDoubleTap() preference.

Contribution

I would like to work on implementing this feature for Scribe-Android!

Metadata

Metadata

Assignees

Labels

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions