Commit graph

13 commits

Author SHA1 Message Date
Mae PUGIN
2f53119178 fix: Heatmap gradient with stepped colors for clarity
mix() was not rendering correctly. Replaced with stepped thresholds:
- >80%: bright red (#ff0000)
- >60%: red-orange (#ff4400)
- >40%: orange (#ff8800)
- >20%: yellow (#ffcc00)
- >5%: cool blue (#446688)
- <=5%: very cold (#2d2d44)

Dark text when heat > 20%. Removed debug eprintln.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:35:08 +02:00
Mae PUGIN
61c3afc344 feat: Auto-refresh data on tab change
- Advanced tab: auto-loads TD, combos, leaders, KO, BT
- Macros tab: auto-loads macro list via binary protocol
- Stats tab: auto-loads heatmap + bigrams
- Only refreshes when connected
- 50ms delays between serial queries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:16:26 +02:00
Mae PUGIN
b4ab9af18b fix: Macro list/save uses binary protocol (LIST_MACROS 0x30)
Firmware v2 doesn't respond to text "MACROS?" query.
Now uses binary LIST_MACROS (0x30) for refresh, with proper
parse_macros_binary() for the response payload.
Save still uses text MACROSEQ, then binary refresh after 100ms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:34:40 +02:00
Mae PUGIN
0813e8531f fix: Auto-slot macros + heatmap auto-load on toggle
- Macro slot auto-assigned from macros.len() (no manual slot selection)
- Heatmap toggle auto-loads KEYSTATS? from firmware
- Debug logs for macro save/refresh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:23:34 +02:00
Mae PUGIN
803505113b fix: Show modifiers in KO list (Shift+H -> Del)
KO list now displays modifier names alongside key names:
- "Shift+H" instead of just "H"
- Uses mod_name() to decode the bitmask

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:15:30 +02:00
Mae PUGIN
e8f4ee41a6 feat: KO creation with checkboxes (matching egui)
- Replace ModComboBox with Ctrl/Shift/Alt checkboxes for KO mods
- Build HID bitmask from checkboxes (Ctrl=0x01, Shift=0x02, Alt=0x04)
- Add DarkCheckbox component (Dracula theme)
- Descriptive label: "When you press [From] key, output [To] key instead"
- Read all KO fields from properties (no args in callback)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 11:06:32 +02:00
Mae PUGIN
33adcc5aa4 fix: Use correct index for combo/KO/leader creation
Index 255 does not mean "auto-assign" in the firmware.
Must use combo_data.len() as next index (matching egui behavior).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:58:07 +02:00
Mae PUGIN
ca21a6766d fix: Stop mixing binary and text serial protocols
Root cause of keyboard malfunction: binary SET/DELETE commands
followed by text QUERY commands confused the firmware state machine.

Changes:
- All create/delete (combo, leader, KO) back to TEXT protocol
  (matching stable egui desktop behavior)
- TD_SET kept binary (isolated, no text query after)
- 50ms delay between all consecutive serial commands
- Removed dead v2 check in refresh_advanced
- Added delay between KEYSTATS? and BIGRAMS? queries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:50:18 +02:00
Mae PUGIN
a8f621e3d6 fix: Remove TAMA/AUTOSHIFT from Refresh All, add query delay
TAMA? and AUTOSHIFT? commands were causing keyboard to malfunction.
Added 50ms delay between serial queries to prevent buffer corruption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:37:42 +02:00
Mae PUGIN
d3ee9ef16f fix: Switch all advanced commands to binary protocol v2
Combo, Leader, KO create/delete all use send_binary() now:
- COMBO_SET (0x60), COMBO_DELETE (0x62)
- LEADER_SET (0x70), LEADER_DELETE (0x72)
- KO_SET (0x91), KO_DELETE (0x93)

Text protocol commands (COMBOSET, COMBODEL, etc.) were not working
with the v2 firmware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:26:52 +02:00
Mae PUGIN
362b0c729c fix: Combo key picker and TD buttons visibility
- Combo picker: pass key index directly instead of relying on selected_key_index
- TD actions: use DarkButton for consistent visibility
- Combo Add: validation message when keys not picked

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:20:54 +02:00
Mae PUGIN
4cfe2fbb7b feat: Editable Tap Dance + combo creation validation
Tap Dance:
- Each TD action is now a clickable button that opens the key selector
- Clicking an action -> pick key from popup -> sends TD_SET binary to firmware
- Labels show 1-tap / 2-tap / 3-tap / hold columns

Combo creation:
- Added validation: "Pick both keys first" message if keys not selected
- Debug log for COMBOSET command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:09:41 +02:00
Mae PUGIN
32ee3a6d26 feat: Complete KeSp Controller — Slint UI port
Full port of the KaSe/KeSp split keyboard configurator from egui to Slint:
- 6 tabs: Keymap, Advanced, Macros, Stats, Settings, Flash
- Responsive keyboard view with scale-to-fit and key rotations
- Key selector popup with categorized grid, MT/LT builders, hex input
- Combo key picker with inline keyboard visual
- Macro step builder with visual tags
- Serial communication via background threads + mpsc polling
- Heatmap overlay with blue-yellow-red gradient
- OTA flasher with prog port VID filtering and partition selector
- WPM polling, Tamagotchi, Autoshift controls
- Dracula theme matching egui version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:40:34 +02:00