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:
@@ -616,3 +616,14 @@ class TestAllAutoFix(unittest.TestCase):
|
||||
key = page["page"]["controls"]["3"]["1"]
|
||||
self.assertIn("all autofix", key["options"]["notes"])
|
||||
self.assertIn("sp_all_cmd", json.dumps(key["steps"]))
|
||||
|
||||
|
||||
class TestLongerHolds(unittest.TestCase):
|
||||
def test_na_page_key_goes_to_status_at_2s_and_locations_at_3s(self):
|
||||
na = json.load(open(os.path.join(ROOT, "config.json")))
|
||||
cfg = dict(na, nav_hold_ms=2000, nav_hold_more=[{"ms": 3000, "page": 98}])
|
||||
st = make_page.nav_key("pagenum", cfg["variables"], 19, 2000, 1, cfg)["steps"]["0"]
|
||||
pages = {k: [a["options"]["page"]["value"] for a in v] for k, v in st["action_sets"].items()}
|
||||
self.assertEqual(pages, {"down": [], "up": [1], "2000": [19], "3000": [98]})
|
||||
self.assertEqual(st["options"]["runWhileHeld"], [2000, 3000])
|
||||
self.assertEqual(schema.validate(cfg)[0], [])
|
||||
|
||||
Reference in New Issue
Block a user