{
    "version": 18,
    "unmapped_passthrough_layers": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7
    ],
    "partial_scroll_timeout": 1000000,
    "tap_hold_threshold": 200000,
    "gpio_debounce_time_ms": 5,
    "interval_override": 0,
    "our_descriptor_number": 0,
    "ignore_auth_dev_inputs": false,
    "macro_entry_duration": 1,
    "gpio_output_mode": 0,
    "input_labels": 0,
    "normalize_gamepad_inputs": true,
    "mappings": [
        {
            "source_usage": "0xfff50005",
            "target_usage": "0xfff10001",
            "layers": [
                0,
                1
            ],
            "sticky": false,
            "tap": false,
            "hold": false,
            "scaling": 1000,
            "source_port": 0,
            "target_port": 0
        },
        {
            "source_usage": "0x00010031",
            "target_usage": "0x00010038",
            "layers": [
                1
            ],
            "sticky": false,
            "tap": false,
            "hold": false,
            "scaling": 10,
            "source_port": 0,
            "target_port": 0
        }
    ],
    "macros": [
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        [],
        []
    ],
    "expressions": [
        "/* ALGORITHM STEP 1: Reset countShake (R1) if >150ms has passed since last shake (R3). */ eol /* If the condition (time - R3 > 150) is true, use 0, otherwise use the old value from R1. */ eol eol time 3000 recall sub 150000 gt 0 1000 recall ifte 1000 store eol eol /* ALGORITHM STEP 2: Detect a valid wiggle. */ eol /* Condition is true if: >500ms since last toggle AND mouse moved left/right AND vertical movement is minimal. */ eol eol /* Check if time - lastShakeSwitch > 500 */ eol time 4000 recall sub 500000 gt eol eol /* Check for rightward shake: mouse.x > 4 AND !lastDir */ eol 0x00010030 input_state 4000 gt 2000 recall not bitwise_and eol eol /* Check for leftward shake: mouse.x < -4 AND lastDir */ eol 0x00010030 input_state -4000 lt 2000 recall bitwise_and eol eol /* Combine left and right shake checks */ eol bitwise_or eol eol /* Check for minimal vertical movement: abs(mouse.y) < 10 */ eol 0x00010031 input_state abs 10000 lt eol eol /* Combine horizontal and vertical checks */ eol swap bitwise_and eol eol /* Combine with the 500ms debounce guard */ eol swap bitwise_and eol eol /* The boolean result is stored in temp Register 6. */ eol 6000 store eol eol /* ALGORITHM STEP 3: If a wiggle was detected (R6=1), update state registers. */ eol eol /* Increment countShake (R1) */ eol 6000 recall 1000 recall 1000 add 1000 recall ifte 1000 store eol eol /* Update lastShake (R3) to current time */ eol 6000 recall time 3000 recall ifte 3000 store eol eol /* Flip lastDir (R2) */ eol 6000 recall 2000 recall not 2000 recall ifte 2000 store eol eol /* ALGORITHM STEP 4: If countShake (R1) > 3, toggle scrolling mode and reset state. */ eol eol /* First, check the condition and store the result in temp Register 7. */ eol 1000 recall 3000 gt 7000 store eol eol /* Based on R7, toggle set_scrolling (R5). */ eol 7000 recall 5000 recall not 5000 recall ifte 5000 store eol eol /* Based on R7, reset countShake (R1) to 0. */ eol 7000 recall 0 1000 recall ifte 1000 store eol eol /* Based on R7, update lastShake (R3). */ eol 7000 recall time 3000 recall ifte 3000 store eol eol /* Based on R7, update lastShakeSwitch (R4) to begin the 250ms debounce. */ eol 7000 recall time 4000 recall ifte 4000 store eol eol /* Cancel if left button is pressed and released */ eol 5000 recall eol 0x00090001 input_state_binary not eol 0x00090001 prev_input_state_binary mul eol not mul eol 5000 store eol eol /* Cancel if back button is pressed and released */ eol 5000 recall eol 0x00090004 input_state_binary not eol 0x00090004 prev_input_state_binary mul eol not mul eol 5000 store eol eol /* Cancel after three seconds of inactivity DOESN'T WORK*/ eol 0x00010030 input_state abs eol 0x00010031 input_state abs eol add /* was there movement? */ eol 3000000 /* if so, reset the counter */ eol 8000 recall 1000 sub /* if not, decrement the counter */ eol ifte eol relu /* don't go below zero */ eol dup eol 8000 store /* store for next frame */ eol 0 eq 5000 store /* this will activate layer 0 */",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    "quirks": []
}