Skip to content

feat: implementation of setModeNamed to specify keyboard modes#29

Merged
albinpk merged 1 commit intoalbinpk:mainfrom
luizfern12:feature/set-mode-named
Feb 5, 2026
Merged

feat: implementation of setModeNamed to specify keyboard modes#29
albinpk merged 1 commit intoalbinpk:mainfrom
luizfern12:feature/set-mode-named

Conversation

@luizfern12
Copy link
Copy Markdown
Contributor

Description

Added setModeNamed(String modeName) to allow switching to a specific keyboard mode by its key name. This implementation includes a check to prevent redundant rebuilds if the requested mode is already active and validates the mode existence within the current layout.

This feature improves efficiency in UI flows where specific input types require immediate access to a particular keyboard layout (e.g., jumping directly to a numeric pad for currency input).

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Verified that the new method correctly updates the keyboard state in a local environment.
  • Ran the provided example app to ensure no regressions in existing switchMode() behavior.
  • Tested a modified version of the example invoking setModeNamed('numeric') from an external trigger with a custom keyboard layout.

Test Configuration:

  • Flutter SDK: 3.38.9
  • Operating System: Linux 6.18.6-arch1-1 (Arch Linux)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Added void setModeNamed to OnScreenKeyboard to allow switching to a specific mode by name, preventing the need to cycle through all modes sequentially.
@albinpk albinpk merged commit 87308d6 into albinpk:main Feb 5, 2026
2 checks passed
@albinpk
Copy link
Copy Markdown
Owner

albinpk commented Feb 5, 2026

@luizfern12 Thanks for the contribution! This is a great addition

@luizfern12 luizfern12 deleted the feature/set-mode-named branch February 5, 2026 14:35
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