Files
clawdmeter/firmware/src/hid.h
T
Hermann Björgvin HaraldssonandClaude Opus 4.6 94d55a88d2 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>
2026-04-01 17:29:06 +00:00

18 lines
322 B
C

#pragma once
#include <Arduino.h>
// Gesture types
enum gesture_t {
GESTURE_NONE,
GESTURE_SWIPE_UP,
GESTURE_SWIPE_DOWN,
GESTURE_SWIPE_LEFT,
GESTURE_SWIPE_RIGHT,
GESTURE_DOUBLE_TAP_LOGO,
GESTURE_HOLD_START,
GESTURE_HOLD_END,
};
void hid_init(void);
void hid_on_gesture(gesture_t gesture);