Skip to content

Rokid Controller: swipes follow the actual drag axis, drop the mode switch - #4386

Closed
hoonsubin wants to merge 8 commits into
espruino:masterfrom
hoonsubin:feat/rokidcontroller-0.04
Closed

hoonsubin wants to merge 8 commits into
espruino:masterfrom
hoonsubin:feat/rokidcontroller-0.04

Conversation

@hoonsubin

Copy link
Copy Markdown

What

Reworks swipe handling in rokidcontroller (v0.04):

  • Swipe direction is now decided from the actual drag: the dominant axis of the gesture (|dx| vs |dy|) maps to Left/Right (horizontal) or Down/Up (vertical). All four directions work at all times.
  • The last in-drag touch position is tracked and used at release, because the release drag event can arrive without usable x/y, which silently swallowed swipes.
  • Removes the axis/invert mode-switch feature: the settings screen, its stored rokidremote.json config, and the double-press-BTN opener are gone (their only rows were the removed toggles). BTN1 is now hold-only (Confirm + 2TAP).

Why

With the previous configured-axis approach, horizontal swipes were never registered when the app was in the default vertical mode, so the glasses' launcher (which moves through its app grid with Left/Right) could not be driven. The on-watch mapping now matches the Rokid navigation contract directly.

Testing

  • node --check app.js passes; metadata.json parses.
  • 10 classifier cases verified (pure horizontal/vertical, diagonals with a dominant axis, sub-threshold dead zone, axis tie).
  • On-device verification against real Rokid glasses is in progress by the author.

hoonsubin and others added 8 commits September 7, 2026 20:00
…#1)

A host classifies a BLE peripheral from its advertising data. Registering the
HID service on the GATT server alone left the advertisement bare, so Android
bound no HID profile to the watch ("No profiles"), never attached an input
device, and the key reports had no consumer.

Also make keyCode() fall back to the default usage code when a name is missing
from kb.KEY, instead of returning undefined and letting kb.tap() throw inside
safeCall.

Bump to 0.02 so the app loader offers the update.

Co-authored-by: agent-miku <74595+agent-miku@noreply.localhost>
…ID errors

The glasses' launcher moves through its app grid with Left/Right and only uses
Up/Down inside vertical lists, so swipes now send the key that matches the
configured axis instead of always sending Up/Down.

Double tap cannot be sent as a keyboard report: no keyboard usage reaches
KEYCODE_BACK. The app now supplies its own composite HID descriptor (report 1
keyboard, report 2 consumer control with AC Back / AC Home), which is the only
HID way to produce a real Back. The keyboard collection carries five keys because
a Bangle.js 2 input report is capped at 8 bytes and the report id counts towards
that length.

HID send failures ("BLE HID not enabled", "Not connected", "report too long") are
now shown on the watch, with "HID OFF" when the service was never registered,
instead of being swallowed.

Bump to 0.03.
- swipe direction is the dominant drag component: horizontal -> Left/Right,
  vertical -> Up/Down, all four directions live with no setting
- track the last in-drag position because the release drag event can carry
  no usable x/y
- remove the axis/invert settings screen, stored config and the double-press
  BTN opener (their only rows were the removed toggles)
@hoonsubin

Copy link
Copy Markdown
Author

Closing - this was opened in error; the work is being tracked on the fork (hoonsubin/BangleApps) for on-device testing first.

@hoonsubin hoonsubin closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant