# Real keyboard path: rebind keyboard controls on Options > Controls
# (Keyboard Configuration) and check the new keys in a race.  The game keeps
# keyboard bindings as DirectInput user maps (dinput_kbd.c: registry file),
# not in the profile.  Run kb_rebind_load.txt afterwards with this run's
# registry and save directory (NFSU2_REGFILE_SEED, NFSU2_SAVE_SEED).
#   Steering (Left):  Escape in the capture cancels it (the game's rule:
#                     dwOfs == DIK_ESCAPE), then J
#   Steering (Right): L          Throttle: I (Up is unbound by that)
#   Shift Up:         Enter      Handbrake: Down arrow (Brake keeps S only)
# [0x874c48] is the keyboard input channel's action mask (active low, bit =
# action id: 1 throttle, 2 brake, 3/4 steer, 5 handbrake, 7 shift up).
0     nstapuntil RETURN MC_Background.fng 120 4000
+120  nstap LEFT                                    # create a profile: Yes
+30   nstap RETURN
+240  nstap BACK
+8    nstap BACK
+8    nstap BACK
+8    nstap BACK
+20   nstype Keys7
+60   nstap RETURN                                  # "save the profile named Keys7?" ("No" selected)
+240  nstap LEFT                                    # "Yes"
+30   nstap RETURN
+240  nstapuntil RETURN GarageMain.fng 150 3000     # "Save complete." Continue -> main menu
+600  nstap RIGHT
+60   nstap RIGHT
+60   nstap RIGHT
+60   nstap RIGHT
+60   nstap RIGHT
+60   nstap RIGHT        # (Split Screen, after Quick Race)
+120  nstap RETURN                                  # Options
+0    waitfng UI_OptionsMain.fng 600
+300  nstap RIGHT
+120  nstap RIGHT
+120  nstap RIGHT
+120  nstap RIGHT
+120  nstap RETURN                                  # Controls
+0    waitfng UI_Options_PC_Controller.fng 600
+300  dump page_before
+0    nstap UP                                      # header
+120  nstap DOWN                                    # Steering (Left)
+90   nstap RETURN                                  # "Press a button..."
+120  dump capture_left
+0    nstap ESCAPE                                  # cancels the capture
+150  dump after_escape
+0    nstap RETURN
+120  nstap J
+150  dump bound_left_J
+0    nstap DOWN                                    # Steering (Right)
+90   nstap RETURN
+120  nstap L
+150  nstap DOWN                                    # Throttle
+90   nstap RETURN
+120  nstap I
+150  nstap DOWN                                    # Back / Reverse
+90   nstap DOWN                                    # Shift Up
+90   nstap RETURN
+120  nstap RETURN                                  # Enter
+150  nstap DOWN                                    # Shift Down
+90   nstap DOWN                                    # Handbrake
+90   nstap RETURN
+120  nstap DOWN                                    # Down arrow
+150  dump page_after
+0    nstap ESCAPE                                  # leave Controls
+300  dump left_controls
+0    nstap ESCAPE                                  # leave Options: no "save the profile?"
+300  dump main_menu                                #   (keyboard keys are not profile data)
+0    nstap LEFT                                    # back to Quick Race
+60   nstap LEFT
+60   nstap LEFT
+60   nstap LEFT
+60   nstap LEFT
+60   nstap LEFT        # (Split Screen, after Quick Race)
+200  nstapuntil RETURN UI_QRModeSelect.fng 150 3000
+200  nstapuntil RETURN UI_QRTrackSelect.fng 150 1500
+200  nstapuntil RETURN UI_QRModeOptions.fng 150 1500
+200  nstapuntil RETURN UI_QRCarSelect.fng 150 1500
+200  nstapuntil RETURN PC_Loading.fng 150 1500
+0    waitmem 0x8654a4 6 3000
+700  dump race_go
+0    log --- J = steer left ---
+0    nsdown J
+30   peek @in+0x2c8
+0    peek 0x874c48 2
+0    nsup J
+30   peek @in+0x2c8
+0    log --- L = steer right ---
+0    nsdown L
+30   peek @in+0x2c8
+0    nsup L
+30   log --- Up (old throttle) does nothing now ---
+0    nsdown UP
+30   peek @in+0x2d4
+0    peek 0x874c48 2
+0    nsup UP
+30   log --- I = throttle ---
+0    nsdown I
+30   peek @in+0x2d4
+0    peek 0x874c48 2
+240  dump race_throttle_I
+0    log --- Enter = shift up (mask bit 7) ---
+0    nsdown RETURN
+10   peek 0x874c48 2
+0    nsup RETURN
+60   log --- Down = handbrake ---
+0    nsdown DOWN
+30   peek @in+0x2ec
+0    peek @in+0x2dc
+0    peek 0x874c48 2
+0    nsup DOWN
+0    nsup I
+60   log --- S = brake still ---
+0    nsdown S
+30   peek @in+0x2dc
+0    nsup S
+60   quit
