feat: add keyboard layout support

This commit is contained in:
2026-08-13 17:57:44 +02:00
parent 86e3ebfe33
commit 821543238d
36 changed files with 1132 additions and 125 deletions
@@ -0,0 +1,59 @@
# MontaukOS Keyboard Layouts
# =============================================================================
# STRUCTURE
# =============================================================================
# [registry]
# layouts: layout ids, in the order they appear in the applet and in the
# panel switcher. "en" is the base layout and is always available
# even if this file is missing or malformed.
#
# [layouts.<id>]
# name: full name shown in the settings applet
# short_name: 2-3 letter tag shown in the desktop panel
# scancodes: PS/2 scancode set 1 codes this layout overrides
# base: character produced unshifted, one per scancode
# shift: character produced with Shift held, one per scancode
# altgr: character produced with AltGr held, one per scancode
#
# Characters are Windows-1252 byte values.
#
# A value of 0x00 means "no override" - the key keeps whatever the kernel's
# US scancode table produced. This is how a layout declares only the keys it
# actually changes.
[registry]
layouts = ["en", "no"]
# =============================================================================
# LAYOUTS
# =============================================================================
[layouts.en]
name = "English (US)"
short_name = "en"
# The US scancode table is built into the kernel, so we don't need to override any keys.
[layouts.no]
name = "Norwegian"
short_name = "no"
scancodes = [
0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0a, 0x0b,
0x0c, 0x0d, 0x12, 0x1a, 0x1b, 0x27, 0x28, 0x29,
0x2b, 0x33, 0x34, 0x35, 0x56,
]
base = [
0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x30, # 2 3 4 6 7 8 9 0
0x2B, 0x5C, 0x00, 0xE5, 0xA8, 0xF8, 0xE6, 0x7C, # + \ . aa ".." oe ae |
0x27, 0x2C, 0x2E, 0x2D, 0x3C, # ' , . - <
]
shift = [
0x22, 0x23, 0xA4, 0x26, 0x2F, 0x28, 0x29, 0x3D, # " # cur & / ( ) =
0x3F, 0x60, 0x00, 0xC5, 0x5E, 0xD8, 0xC6, 0xA7, # ? ` . AA ^ OE AE sec
0x2A, 0x3B, 0x3A, 0x5F, 0x3E, # * ; : _ >
]
altgr = [
0x40, 0xA3, 0x24, 0x00, 0x7B, 0x5B, 0x5D, 0x7D, # @ GBP $ . { [ ] }
0x00, 0xB4, 0x80, 0x00, 0x7E, 0x00, 0x00, 0x00, # . ' EUR . ~ . . .
0x00, 0x00, 0x00, 0x00, 0x5C, # . . . . backslash
]