Skip to content

Conversation

@timurey
Copy link

@timurey timurey commented Dec 7, 2025

Hey!
I've implemented the ability to change the keyboard layout for locales supported by Meshtastic fonts: RU, UA, PL, CZ.
It works on devices with CardKB and T-Desk, the keyboard shortcut for changing the layout is fn-L.

In addition to adding a layout change handler and a mapping table for various layouts, I've added code to support UTF-8 strings in the message input field.

I can't add support for other input devices, but I think this will be a good start for adding other layouts and expanding the supported input device types in different languages.

I only tested the firmware on devices with high resolutions (e-ink, T-Deck), but it should work well on OLED displays as well.
out

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • T-Deck
    • Heltec E213
    • Heltec E290
    • NRF52 Pro-micro DIY

@CLAassistant
Copy link

CLAassistant commented Dec 7, 2025

CLA assistant check
All committers have signed the CLA.

@timurey timurey changed the title Add keyboard layout [Ru, Pl, Cz, Ua] Add keyboard layout [Ru, Pl, Cz, Ua] for T-Deck and CardKB devices Dec 7, 2025
@fifieldt fifieldt added the enhancement New feature or request label Dec 8, 2025
@fifieldt fifieldt force-pushed the feature/keyboard_layout branch from 41c6fcd to 3ef97f9 Compare December 8, 2025 20:22
@fifieldt fifieldt requested a review from Copilot December 8, 2025 20:23
@fifieldt
Copy link
Member

fifieldt commented Dec 8, 2025

Thanks, this looks like a nice implementation.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jp-bennett
Copy link
Collaborator

I don't love that the character replacement logic is in cannedMessages. That module is already too much of a catch-all.

@timurey
Copy link
Author

timurey commented Dec 9, 2025

Great point, I completely agree. cannedMessages is indeed turning into a module that does too much. The character replacement logic for keyboard layouts is a separate responsibility.

My proposal: I'll move it out into a dedicated kbLayout.c/.h module, as you suggested.
It will expose a function, const char *applyCurrentLayout(char key) which cannedMessages can call.
Also I’ll move keyboard layouts mapping tables, so all layout-specific data will be encapsulated in the new module.
The current module will have a layout indicator and utf8 character processing functions

@timurey
Copy link
Author

timurey commented Dec 11, 2025

Sorry for messy commit history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants