Add USB HID keyboard input via touch gestures

The SC01 Plus now acts as a composite USB device (CDC serial + HID keyboard).
Touch gestures on the screen send keystrokes to the computer:

- Swipe up/down: arrow keys
- Swipe right: Enter
- Swipe left: Shift+Tab (change mode in Claude Code)
- Double-tap logo: Ctrl+Space (voice mode)
- Tap and hold: Space (held while touching)

Gesture-to-key mapping is defined as a simple config table in hid.cpp.
Touch detection uses a state machine with configurable thresholds in touch.cpp.

Switches to TinyUSB composite mode (ARDUINO_USB_MODE=0). Flashing now
requires flash.sh which handles the DTR/RTS bootloader reset.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann Björgvin Haraldsson
2026-04-01 17:29:06 +00:00
co-authored by Claude Opus 4.6
parent 2611c70881
commit 94d55a88d2
7 changed files with 252 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ monitor_speed = 115200
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-UARDUINO_USB_MODE -DARDUINO_USB_MODE=0
-DBOARD_HAS_PSRAM
; LVGL config via build flags
-DLV_CONF_SKIP