Settings services: Difference between revisions

 
(3 intermediate revisions by the same user not shown)
Line 61: Line 61:


== GetKeyCodeMap ==
== GetKeyCodeMap ==
Takes a type-0x16 output buffer containing KeyCodeMap, official sw uses fixed size 0x1000. This is probably related to HID keyboard.
Takes a type-0x16 output buffer containing KeyCodeMap, official sw uses fixed size 0x1000. This is related to the USB HID keyboard.
 
The returned buffer consists of a 0x20-byte header followed by an array of key mapping structures.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Magic number? (0x01000001)
|-
| 0x4 || 0x4 || Entry count per key (3 for US English, 4 for German as it includes AltGr mappings)
|-
| 0x8 || 0x4 || Map count
|-
| 0xC || 0x4 || Layout ID (e.g. 3 = German QWERTZ)
|-
| 0x10 || 0x10 || Reserved
|-
| 0x20 || 0x8 * MapCount || Array of <code>KeyMapEntry</code> structures. Indexed by the standard USB HID Usage ID (Keyboard/Keypad page 0x07).
|-
| ... || ... || Padding (remaining space up to 0x1000)
|}
 
=== KeyMapEntry ===
Structure defining the output characters and modifier behaviors for a single physical key. Size may vary depending on the symbol count per key.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x2 || Normal char: UTF-16 code point when no modifiers are pressed. Dead keys map directly to Unicode combining characters (like U+0301 for combining acute accent).
|-
| 0x2 || 0x2 || Flags: Bitmask for character behavior and modifier rules.
|-
| 0x4 || 0x2 || Shift char: UTF-16 code point emitted when Shift is held.
|-
| 0x6 || 0x2 || AltGr char: UTF-16 code point emitted when AltGr is held (only included if the 'entry count per key' = 4)
|}
 
The Flags field changes how state changes are handled (like Caps Lock or NumLock) for that specific code point:
* 0x1001: Standard character. Uses standard Shift and Caps Lock rules.
* 0x1000: Static/dead character (e.g., Space).
* 0x20FF: Keypad modifier. State influenced by NumLock.


== GetFirmwareVersionForDebug ==
== GetFirmwareVersionForDebug ==