NA page-number key: hold 2 s = status page, keep holding to 3 s = LOCATIONS page
- nav_hold_more: longer holds go further (tested on NA's Companion emulator: 2.5 s -> 19, 3.5 s -> 98, tap -> 1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -333,6 +333,14 @@ def nav_key(kind, names, status_page=None, hold_ms=1000, tap_page=1, cfg=None):
|
||||
"options": {"surfaceId": prop("self"), "page": prop(status_page)}, "children": {}}]
|
||||
step["action_sets"] = {"down": [], "up": tap, str(hold_ms): hold}
|
||||
step["options"]["runWhileHeld"] = [hold_ms]
|
||||
# Longer holds go further (NA, 2026-10-21: 2 s the status page, still held at 3 s the LOCATIONS page).
|
||||
for i, more in enumerate(sorted((cfg or {}).get("nav_hold_more") or [], key=lambda m: m["ms"])):
|
||||
if more["ms"] > hold_ms:
|
||||
step["action_sets"][str(more["ms"])] = [{"type": "action", "id": stable_id("nav", "hold%d" % (i + 2)),
|
||||
"definitionId": "set_page", "connectionId": "internal",
|
||||
"options": {"surfaceId": prop("self"), "page": prop(more["page"])},
|
||||
"children": {}}]
|
||||
step["options"]["runWhileHeld"].append(more["ms"])
|
||||
key["options"]["notes"] = ("%s (%s): colour follows the ALL button on the status page. "
|
||||
"Undo on every page with: python3 nav_keys.py --revert" % (NAV_MARKER, kind))
|
||||
return key
|
||||
|
||||
Reference in New Issue
Block a user