Skip to content

Use the configured keyboard layout for the on-screen keyboard - #791

Open
Gjuju wants to merge 2 commits into
moode-player:developfrom
Gjuju:contrib/osk-keyboard-layout
Open

Use the configured keyboard layout for the on-screen keyboard#791
Gjuju wants to merge 2 commits into
moode-player:developfrom
Gjuju:contrib/osk-keyboard-layout

Conversation

@Gjuju

@Gjuju Gjuju commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The on-screen keyboard's Latin layer is hardcoded to QWERTY, so on a panel used with an
AZERTY or QWERTZ keyboard the letters aren't where the user expects them.

initializeOSK() now reads the XKB layout code already set in Configure > System >
Keyboard layout
and swaps the Latin table when the code calls for it — no new setting.
The code lists come from the X11 keyboard database and cover every Latin layout the
selector offers: AZERTY for be cd fr ml sn, QWERTZ for al at ba ch cz de hr hu me si sk, QWERTY for the other 37.

Untouched: the accented and Cyrillic layers, the layer cycle key, the numeric mode and
osk.css — both tables fit the existing 4x11 grid, and letters that don't fit (the German
eszett, say) are already on the accented layer. keyboard is a session-only var, so one
line in addExtraSessionVars() exposes it to the WebUI.

Tested on a touch panel with XKBLAYOUT="fr". An unknown or unset code keeps QWERTY, so
nothing changes for existing users; adding another variant later is one table plus one
code list.

Commits

  • Use the configured keyboard layout for the on-screen keyboard — the change above.
  • Fix a lowercase che in the uppercase Cyrillic row — unrelated but adjacent, one character.

@Gjuju
Gjuju force-pushed the contrib/osk-keyboard-layout branch from 7ff3baf to 728f5a4 Compare September 8, 2026 07:49
The popup keyboard's Latin layer is hardcoded to QWERTY, so on a panel used
with an AZERTY or QWERTZ keyboard the letters do not match the keys the user
knows, and every word has to be hunted for.

Pick the key positions from the XKB layout code already set in Configure >
System > Keyboard layout: initializeOSK() now takes it and swaps the Latin
table for AZERTY or QWERTZ when the code calls for it. The code lists were
taken from the X11 keyboard database, and cover every Latin layout offered
by the Keyboard layout selector: 5 AZERTY (be cd fr ml sn), 11 QWERTZ
(al at ba ch cz de hr hu me si sk) and 37 that stay on QWERTY.

Everything else is untouched - the accented and Cyrillic layers, the layer
cycle key, the numeric mode and the CSS - as both tables fit the existing
4x11 grid. Letters that do not fit, such as the German eszett, are already
on the accented layer. Unknown or unset codes keep QWERTY, so nothing
changes for existing users.

The layout code is a session-only var, so it is added to the cfg tables the
WebUI reads. Adding another variant later is one table plus one code list.
@Gjuju
Gjuju force-pushed the contrib/osk-keyboard-layout branch from 728f5a4 to 7963b10 Compare September 9, 2026 17:45
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