simcap

SIMCAP KEYBOARD

BLE HID Keyboard Firmware for Puck.js

Converts Puck.js button presses and gestures into Bluetooth keyboard/media key events. Pairs as a standard HID keyboard with any Bluetooth-enabled device.

Features

graph TB
    subgraph "Input"
        BTN[Button]
        TILT[Tilt Gesture]
        NFC[NFC Tap]
    end

    subgraph "Modes"
        MACRO[Macro Mode]
        GESTURE[Gesture Mode]
        MEDIA[Media Mode]
    end

    subgraph "Output"
        KEYS[Key Press]
        ARROWS[Arrow Keys]
        PLAYBACK[Media Controls]
    end

    BTN --> MACRO
    BTN --> MEDIA
    TILT --> GESTURE
    TILT --> MEDIA
    NFC --> |Cycle| MACRO
    NFC --> |Cycle| GESTURE
    NFC --> |Cycle| MEDIA

    MACRO --> KEYS
    GESTURE --> ARROWS
    MEDIA --> PLAYBACK

Modes

Macro Mode (Default)

Config Example Description
CONFIG.macroKey = "copy" Ctrl+C Use preset macro
CONFIG.macroKey = "a" ‘a’ Single key
CONFIG.macroModifier = MODIFIERS.CTRL Ctrl+key Add modifier

Preset Macros:

Gesture Mode

Tilt Key
Up Arrow Up
Down Arrow Down
Left Arrow Left
Right Arrow Right

Media Mode

Controls

Action Input Result
Execute macro/key Button press Depends on mode
Cycle mode NFC tap Macro → Gesture → Media
Toggle on/off Long press (1s) Green (on) / Red (off)

Configuration

Via BLE console:

// Set macro to Ctrl+S (save)
CONFIG.macroKey = "save";

// Or custom key combo
CONFIG.macroKey = "s";
CONFIG.macroModifier = MODIFIERS.CTRL;

// Change mode
CONFIG.mode = "gesture";  // or "macro" or "media"

// Adjust gesture sensitivity
CONFIG.gestureThreshold = 3000;

Console Functions

// Send specific key
sendKey(kb.KEY.ENTER, 0);

// Send key with modifier
sendKey(kb.KEY.C, MODIFIERS.CTRL);

// Execute preset macro
sendMacro("copy");

// Type a string
typeString("Hello World");

// Get status
getTelemetry();

State Machine

stateDiagram-v2
    [*] --> MacroMode: Power on

    MacroMode --> GestureMode: NFC tap
    GestureMode --> MediaMode: NFC tap
    MediaMode --> MacroMode: NFC tap

    MacroMode --> Disabled: Long press
    GestureMode --> Disabled: Long press
    MediaMode --> Disabled: Long press
    Disabled --> MacroMode: Long press

Pairing

  1. Upload firmware to Puck.js
  2. Open Bluetooth settings on your device
  3. Look for “SIMCAP Keys”
  4. Pair and connect
  5. Press button to test

Technical Details

Installation

Use the Firmware Loader or Espruino Web IDE:

  1. Connect to Puck.js
  2. Copy contents of app.js
  3. Paste and send to device
  4. Save to flash: save()

← Back to SIMCAP