Themes, actions, text snippets and a key picker

This commit is contained in:
Mohamed Mahjoub
2026-09-22 17:16:17 +01:00
committed by GitHub
parent ed707b1ae7
commit 8a18015c34
35 changed files with 2470 additions and 142 deletions

View File

@@ -62,6 +62,8 @@ KEYCODES.update({
})
for _i in range(1, 13):
KEYCODES[f"f{_i}"] = 57 + _i # F1 = 58 .. F12 = 69
for _i in range(13, 25):
KEYCODES[f"f{_i}"] = 0x68 + _i - 13 # F13 = 0x68 .. F24 = 0x73
# Media keys live on the Consumer usage page, sent as a 16-bit value.
MEDIA_KEYS = {
@@ -247,9 +249,15 @@ LAYERS = 3
def native_info(report_id):
"""Ask the pad what it is. Reply carries the key and knob counts."""
"""
Ask the pad what it is. Reply carries the key and knob counts.
The vendor sends the command byte three times over. In the read command
below the bytes after the first carry meaning, so these may too; we
repeat them rather than guess that they are padding.
"""
data = bytearray(REPORT_LEN - 1)
data[0] = MAGIC_INFO
data[0] = data[1] = data[2] = MAGIC_INFO
return bytes([report_id]) + bytes(data)